[jira] [Commented] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Richard N. Hillegas (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17616095#comment-17616095
 ] 

Richard N. Hillegas commented on DERBY-7145:


One thing that looks suspicious to me is the following:

For the failing case (with the DEFAULT clause), the type of the stored CS value 
in the spillover conglomerate is SQLInteger. For the successful case (without 
the DEFAULT clause), the type of that stored value is a SQLLongint. This could 
explain the deserialization error: we are trying to read back a SQLLongint from 
a shorter SQLInteger value.

It may take a little while to chase this down, since the SQLInteger is being 
instantiated inside generated code.


> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1, 10.17.0.0
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)
>   at 
> org.apache.

[INFO] DB Report for October, 2022

2022-10-11 Thread Bryan Pendleton
Below is the quarterly report I submitted to the board. I think
this was a quiet quarter for everybody, hope all is well.

Thanks and let me know if I missed anything.

bryan

## Description:
The mission of the Apache DB project is to create and maintain
commercial-quality, open-source, database solutions based on software licensed
to the Foundation, for distribution at no charge to the public.

The Apache DB TLP consists of the following subprojects:
 o Derby: a relational database implemented entirely in Java.
 o JDO  : focused on building the API and the TCK for compatibility
  testing of Java Data Object implementations providing data
  persistence.
 o Torque   : an object-relational mapper for Java.

## Issues:
There are no issues requiring board attention.

## Membership Data:
Apache DB was founded 2002-07-16 (20 years ago)
There are currently 47 committers and 44 PMC members in this project.
The Committer-to-PMC ratio is roughly 1:1.

Community changes, past quarter:
- No new PMC members. Last addition was Georg Kallidis on 2020-08-26.
- No new committers. Last addition was Tobias Bouschen on 2021-01-19.

## Project Activity:
Recent releases:

- Derby-10.16.1.1 was released on 2022-06-15.
- JDO 3.2.1 was released on 2022-05-25.
- JDO 3.2 was released on 2022-02-01.
- Torque 5.1 was released on 2022-01-31.

## Community Health:
This was a very quiet quarter for the DB subprojects, but all
the communities had fairly typical activity: questions were
asked and answered on the community mailing lists, issues were
raised and fixes were discussed and committed.


[jira] [Commented] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Richard N. Hillegas (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615964#comment-17615964
 ] 

Richard N. Hillegas commented on DERBY-7145:


Many test cases in MergeStatementTest operate on small source row sets which 
drive the MERGE. They only test the code path where we do NOT spill overflow 
rows into a temporary conglomerate. For instance, 
MergeStatementTest.test_007_insertGeneratedColumnsAndDefaults() operates on row 
sets containing 4 rows. It is likely that there are more weaknesses in the 
spillover code path.

> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1, 10.17.0.0
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)
>   at 
> org.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet.getNextRowCore(TemporaryRowHolderResultSet.java:499)
>   at 
> org.apache.derby.im

[jira] [Commented] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Stanimir Stamenkov (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615953#comment-17615953
 ] 

Stanimir Stamenkov commented on DERBY-7145:
---

I've misread your modified example – I thought I'm looking at the WHEN MATCHED 
UPDATE case.  The latter appears unaffected by the removal of the DEFAULT 
constraint (as I've noticed in the complex demo).

> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1, 10.17.0.0
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)
>   at 
> org.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet.getNextRowCore(TemporaryRowHolderResultSet.java:499)
>   at 
> org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(DMLWriteResultSet.java:148)
>   at 
> org.apache.derby.impl.sql.execute.UpdateResultSet.getNextRowCore(UpdateResultSet.java:670)
>

[jira] [Commented] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Bryan Pendleton (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615945#comment-17615945
 ] 

Bryan Pendleton commented on DERBY-7145:


> when the UPDATE count > 5

Makes me think of 
https://issues.apache.org/jira/browse/DERBY-7144?focusedCommentId=17574762&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17574762
 and its observation that the rowcount of 5 is related to the behind-the-scenes 
creation of a temporary conglomerate.

> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1, 10.17.0.0
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)
>   at 
> org.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet.getNextRowCore(TemporaryRowHolderResultSet.java:499)
>   at 
> org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(DMLWriteResultSe

[jira] [Commented] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Stanimir Stamenkov (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615934#comment-17615934
 ] 

Stanimir Stamenkov commented on DERBY-7145:
---

Just clarifying the repro details – Removing the DEFAULT constraint is not 
possible with the second "Only INSERTs" scenario, for example.

Removing the DEFAULT (and NOT NULL) constraint from the TMP column in my 
initial more complex demo – I'm still seeing the problem in the "Only UPDATEs" 
case, or when the UPDATE count > 5.

> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1, 10.17.0.0
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)
>   at 
> org.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet.getNextRowCore(TemporaryRowHolderResultSet.java:499)
>   at 
> org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(DMLWriteR

[jira] [Updated] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Richard N. Hillegas (Jira)


 [ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard N. Hillegas updated DERBY-7145:
---
Bug behavior facts: Seen in production,Wrong query result  (was: Crash,Data 
corruption)
   Urgency: Normal
 Affects Version/s: 10.17.0.0

The good news is that this bug does not crash the connection.

> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1, 10.17.0.0
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)
>   at 
> org.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet.getNextRowCore(TemporaryRowHolderResultSet.java:499)
>   at 
> org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(DMLWriteResultSet.java:148)
>   at 
> org.apache.derby.impl.sql.execute.UpdateResultSet.getNextRowCore(UpdateResultSet.java:670)
>   at 
> org.apache.derby.impl.sql.e

[jira] [Commented] (DERBY-7145) MERGE UPDATE failing: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored

2022-10-11 Thread Richard N. Hillegas (Jira)


[ 
https://issues.apache.org/jira/browse/DERBY-7145?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615880#comment-17615880
 ] 

Richard N. Hillegas commented on DERBY-7145:


The problem goes away if we remove the DEFAULT constraint:

{noformat}
ij> CONNECT 'jdbc:derby:memory:db;create=true';
ij> CREATE TABLE targetData (ID BIGINT, CS BIGINT);
0 rows inserted/updated/deleted
ij> CREATE TABLE sourceData (ID BIGINT);
0 rows inserted/updated/deleted
ij> INSERT INTO sourceData VALUES (10), (20), (30), (40), (50), (60);
6 rows inserted/updated/deleted
ij> MERGE INTO targetData target USING sourceData source ON target.ID = 
source.ID
WHEN NOT MATCHED THEN INSERT (ID) VALUES (source.ID);
6 rows inserted/updated/deleted
{noformat}


> MERGE UPDATE failing: Restore of a serializable or SQLData object of class , 
> attempted to read more data than was originally stored
> ---
>
> Key: DERBY-7145
> URL: https://issues.apache.org/jira/browse/DERBY-7145
> Project: Derby
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 10.14.2.0, 10.15.2.0, 10.16.1.1
> Environment: Windows 10, JDK 8, Derby 10.14.2.0;
> Windows 10, JDK 11, Derby 10.15.2.0;
> Windows 10, JDK 17, Derby 10.16.1.1.
>Reporter: Stanimir Stamenkov
>Priority: Major
> Attachments: bug-demo3.zip, derby.log, derby2.log, sysinfo.txt
>
>
> _\[May be related to DERBY-7144.\]_
> [^bug-demo3.zip] – a revision of {{bug-demo2.zip}} in DERBY-7144.  Extract;  
> Copy the Derby JARs to a {{lib/}} subdirectory; Compile:
> {noformat}
> $ mkdir classes
> $ javac -d classes src/net/example/derby/*.java
> {noformat}
> Run to see the problem:
> {noformat}
> $ java -cp "classes;lib/*" net.example.derby.BugDemo -seed -merge -print
> {noformat}
> {noformat}
> Exception in thread "main" java.sql.SQLException: Restore of a serializable 
> or SQLData object of class , attempted to read more data than was originally 
> stored
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
>   at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:252)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:431)
>   at 
> org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353)
>   at 
> org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2405)
>   at 
> org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:88)
>   at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1436)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1709)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeLargeUpdate(EmbedPreparedStatement.java:320)
>   at 
> org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:309)
>   at net.example.derby.BugDemo.mergeData(BugDemo.java:125)
>   at net.example.derby.BugDemo.run(BugDemo.java:254)
>   at net.example.derby.BugDemo.main(BugDemo.java:224)
> Caused by: ERROR XSDA7: Restore of a serializable or SQLData object of class 
> , attempted to read more data than was originally stored
>   at 
> org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
>   at 
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
>   ... 13 more
> Caused by: java.io.EOFException
>   at 
> org.apache.derby.iapi.services.io.ArrayInputStream.readLong(ArrayInputStream.java:323)
>   at 
> org.apache.derby.iapi.types.SQLLongint.readExternal(SQLLongint.java:184)
>   at 
> org.apache.derby.iapi.types.DataType.readExternalFromArray(DataType.java:276)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.readRecordFromArray(StoredPage.java:5676)
>   at 
> org.apache.derby.impl.store.raw.data.StoredPage.restoreRecordFromSlot(StoredPage.java:1514)
>   at 
> org.apache.derby.impl.store.raw.data.BasePage.fetchFromSlot(BasePage.java:450)
>   at 
> org.apache.derby.impl.store.raw.data.CachedPage.fetchFromSlot(CachedPage.java:53)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1518)
>   at 
> org.apache.derby.impl.store.access.conglomerate.GenericScanController.fetch(GenericScanController.java:1487)