Issue Details (XML | Word | Printable)

Key: DERBY-3978
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Kristian Waagan
Reporter: Kristian Waagan
Votes: 0
Watchers: 0
Operations

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

Clob.truncate(long) in the client driver doesn't update the cached Clob length

Created: 08/Dec/08 02:01 PM   Updated: 04/May/09 06:22 PM
Component/s: JDBC, Network Client
Affects Version/s: 10.3.3.0, 10.4.2.0, 10.5.1.1
Fix Version/s: 10.3.3.1, 10.4.2.1, 10.5.1.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-3978-1a-regression_tests.diff 2008-12-08 02:17 PM Kristian Waagan 5 kB
File Licensed for inclusion in ASF works derby-3978-2a-update_length.diff 2008-12-08 02:20 PM Kristian Waagan 0.9 kB

Resolution Date: 11/Dec/08 11:18 AM


 Description  « Hide
The client driver caches the Clob length, but doesn't update it when Clob.truncate is called.

I will attach a few regression tests, where one of them demonstrates the issue. The fix is also very simple; update the cached length.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kristian Waagan added a comment - 08/Dec/08 02:17 PM
Attached patch 1a with a small set of regression tests, one of them demonstrates the bug.
The tests are added to jdbcapi.ClobTest.

I also documented a utility method in the test class.

Kristian Waagan made changes - 08/Dec/08 02:17 PM
Field Original Value New Value
Attachment derby-3978-1a-regression_tests.diff [ 12395559 ]
Kristian Waagan added a comment - 08/Dec/08 02:20 PM
Patch 2a is a simple fix for the bug.
Another option is to pull both updates out of the if-else block.

Running regression tests.
Patch ready for review.

Kristian Waagan made changes - 08/Dec/08 02:20 PM
Attachment derby-3978-2a-update_length.diff [ 12395561 ]
Repository Revision Date User Message
ASF #724657 Tue Dec 09 10:24:18 UTC 2008 kristwaa DERBY-3978: Clob.truncate(long) in the client driver doesn't update the cached Clob length.
Make the client driver update the length of the Clob when it has been truncated.Added a few tests.

Patch file: DERBY-3978-1a-regression_tests.diff, DERBY-3978-2a-update_length.diff
Files Changed
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/am/Clob.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java

Kristian Waagan added a comment - 09/Dec/08 10:25 AM
Regression tests ran without failures.
Committed patches 1a and 2a to trunk with revision 724657.

Awaiting test results and community feedback before I backport the changes.

Kristian Waagan made changes - 09/Dec/08 10:25 AM
Derby Info [Patch Available]
Fix Version/s 10.5.0.0 [ 12313010 ]
Repository Revision Date User Message
ASF #725620 Thu Dec 11 08:47:56 UTC 2008 kristwaa DERBY-3978: Clob.truncate(long) in the client driver doesn't update the cached Clob length.
Backported revision 724657 (patches 1a and 2a) from trunk.
Files Changed
MODIFY /db/derby/code/branches/10.4/java/client/org/apache/derby/client/am/Clob.java
MODIFY /db/derby/code/branches/10.4/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java

Kristian Waagan added a comment - 11/Dec/08 09:25 AM
Backported patches 1a and 2a to the 10.4 branch with revision 725620. Regressions tests ran cleanly.
Merge to 10.3 was also clean, running tests now.

Kristian Waagan made changes - 11/Dec/08 09:25 AM
Fix Version/s 10.4.2.1 [ 12313401 ]
Repository Revision Date User Message
ASF #725662 Thu Dec 11 11:17:16 UTC 2008 kristwaa DERBY-3978: Clob.truncate(long) in the client driver doesn't update the cached Clob length.
Backported fix from 10.4 (revision 725620).
Files Changed
MODIFY /db/derby/code/branches/10.3/java/client/org/apache/derby/client/am/Clob.java
MODIFY /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ClobTest.java

Kristian Waagan added a comment - 11/Dec/08 11:18 AM
Regression tests on the 10.3 branch ran successfully.
Backported with revision 725662.

This concludes the work on this issue. Awaiting confirmation from test runs before closing.

Kristian Waagan made changes - 11/Dec/08 11:18 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 10.3.3.1 [ 12313143 ]
Kristian Waagan added a comment - 05/Jan/09 11:37 AM
No problems reported. Closing the issue.

Kristian Waagan made changes - 05/Jan/09 11:37 AM
Status Resolved [ 5 ] Closed [ 6 ]
Myrna van Lunteren made changes - 04/May/09 06:22 PM
Fix Version/s 10.5.0.0 [ 12313010 ]
Fix Version/s 10.5.1.1 [ 12313771 ]
Affects Version/s 10.5.0.0 [ 12313010 ]
Affects Version/s 10.5.1.1 [ 12313771 ]