Issue Details (XML | Word | Printable)

Key: DERBY-3238
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Kathey Marsden
Reporter: Stan Bradbury
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

When table contains large LOB values (> ~32K) trigger execution fails for that row with ERROR XCL30: An IOException was thrown when reading a 'BLOB'

Created: 30/Nov/07 10:08 PM   Updated: 24/Jan/08 11:07 PM
Return to search
Component/s: SQL
Affects Version/s: 10.1.3.1, 10.2.2.0, 10.3.1.4, 10.3.2.1, 10.4.1.3
Fix Version/s: 10.1.3.2, 10.2.2.1, 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Java Source File Licensed for inclusion in ASF works blob_insert2.java 2007-11-30 10:09 PM Stan Bradbury 4 kB
Text File Licensed for inclusion in ASF works derby-3238_10_1_diff.txt 2007-12-06 12:27 AM Kathey Marsden 13 kB
Text File Licensed for inclusion in ASF works derby-3238_diff.txt 2007-12-01 12:38 AM Kathey Marsden 7 kB
Text File Licensed for inclusion in ASF works derby-3238_diffv2.txt 2007-12-03 07:13 PM Kathey Marsden 7 kB
Text File Licensed for inclusion in ASF works derby-3238_diffv3.txt 2007-12-03 07:52 PM Kathey Marsden 7 kB
Text File Licensed for inclusion in ASF works derby-3238_diffv4.txt 2007-12-03 11:33 PM Kathey Marsden 10 kB

Issue & fix info: Patch Available
Resolution Date: 06/Dec/07 02:42 PM


 Description  « Hide
See attached test case.
At execution/run-time a trigger that handles a row that contains a large LOB value will fail with the following error and stack trace:
 = = =
Testing blob of size=1024

 . . Now executing update to fire the trigger
PASSED
Testing blob of size=16384

 . . Now executing update to fire the trigger
PASSED
Testing blob of size=32658

 . . Now executing update to fire the trigger
PASSED
Testing blob of size=32659

 . . Now executing update to fire the trigger
Error! java.sql.SQLException: An IOException was thrown when reading a 'BLOB' from an InputStream.
java.sql.SQLException: An IOException was thrown when reading a 'BLOB' from an InputStream.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
        at blob_insert2.testBlob(blob_insert2.java:102)
        at blob_insert2.main(blob_insert2.java:55)
Caused by: java.sql.SQLException: Java exception: ': java.io.EOFException'.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        ... 9 more
Caused by: java.io.EOFException
        at org.apache.derby.iapi.types.SQLBinary.readBinaryLength(Unknown Source)
        at org.apache.derby.iapi.types.SQLBinary.readExternal(Unknown Source)
        at org.apache.derby.iapi.types.SQLBinary.getValue(Unknown Source)
        at org.apache.derby.iapi.types.SQLBinary.loadStream(Unknown Source)
        at org.apache.derby.impl.sql.execute.UpdateResultSet.objectifyStream(Unknown Source)
        at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(Unknown Source)
        at org.apache.derby.impl.sql.execute.UpdateResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        ... 5 more





 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #601110 Tue Dec 04 22:16:08 UTC 2007 kmarsden DERBY-3238 When table contains large LOB values (> ~32K) trigger execution fails for that row with ERROR XCL30: An IOException was thrown when reading a 'BLOB'

When a trigger is present, unchanged columns with be part of the UpdateResultSet. These columns are present twice in the result set as a before and after value. There was code to "objectify" the before value but the after value was not getting updated. Changed objectifyStream to make sure after values point to data value and not the stream after objectifyStream occurs.
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java

Repository Revision Date User Message
ASF #601118 Tue Dec 04 22:26:11 UTC 2007 kmarsden DERBY-3238 minor cleanup in TriggerTest to remove getConnection() calls
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java

Repository Revision Date User Message
ASF #601414 Wed Dec 05 17:09:18 UTC 2007 kmarsden DERBY-3238 When table contains large LOB values (> ~32K) trigger execution fails for that row with ERROR XCL30: An IOException was thrown when reading a 'BLOB'

backport from trunk revision 601110
Files Changed
MODIFY /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
MODIFY /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java

Repository Revision Date User Message
ASF #601512 Wed Dec 05 20:40:29 UTC 2007 kmarsden DERBY-3238 When table contains large LOB values (> ~32K) trigger execution fails for that row with ERROR XCL30: An IOException was thrown when reading a 'BLOB'

merge 601110 from trunk. Rewrite test for old harness.
Files Changed
MODIFY /db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
MODIFY /db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
ADD /db/derby/code/branches/10.2/java/testing/org/apache/derbyTesting/functionTests/tests/lang/bug3238.java

Repository Revision Date User Message
ASF #601746 Thu Dec 06 14:40:12 UTC 2007 kmarsden DERBY-3238 When table contains large LOB values (> ~32K) trigger execution fails for that row with ERROR XCL30: An IOException was thrown when reading a 'BLOB'

merge from trunk revision 601110 and also merge DERBY-1417 revision 437980 to avoid materialization during SQLBlob.setWidth.
Files Changed
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/SQLBlob.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
ADD /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/bug3238.out
MODIFY /db/derby/code/branches/10.1/java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
ADD /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/lang/bug3238.java

Repository Revision Date User Message
ASF #604042 Thu Dec 13 21:46:09 UTC 2007 kmarsden DERBY-3238 Add test cases when the lob columns are referenced and referenced multiple times.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerTest.java