|
We don't have any good alternatives in my opinion, but I'm curious about what the databases that do support truncating to length+1 do!
I'll make a patch for the issue.
Kristian Waagan made changes - 09/Dec/08 02:32 PM
PostgreSQL's JDBC driver doesn't appear to throw an exception for len>=length+1. In code called from Clob.truncate(), I found this comment:
/** * Truncates the large object to the given length in bytes. * If the number of bytes is larger than the current large * object length, the large object will be filled with zero * bytes. This method does not modify the current file offset. */ The comment talks about bytes, but the code is also used for character data, so I guess truncate(length+1) appends "\u0000". MySQL Connector/J throws an exception, if I read the code correctly. JCC 3.57 with DB2 throws an SQLException, SQLState 42815. Invalid length x
Patch 1a changes the exception thrown in the embedded driver from XJ076 to XJ079. It now matches the client driver.
I ran derbyall and suites.All, and got no failures due to the change of exception (except for the two new tests, which I have modified in the patch). Patch ready for review.
Kristian Waagan made changes - 10/Dec/08 02:32 PM
Kristian Waagan made changes - 10/Dec/08 02:32 PM
Attached a first revision of the release notes. Please give me feedback on it.
I also discovered a typo in the error message for one of the exceptions. Fixing that doesn't warrant another release note, does it?
Kristian Waagan made changes - 11/Dec/08 09:50 AM
The release note looks good to me. Some minor comments:
Perhaps the example error messages should have a real number instead of {0} in them? And maybe that section is clearer if we say "Before: XJ076: ...." and "Now: XJ079: ....". In the "Application Changes Required" section, we should repeat that it's only when calling Clob.truncate() one should look for XJ079 instead of XJ076, since we still use XJ076 other places. For example: "Look for SQLState XJ079 instead of XJ076 when Clob.truncate() is called." Thank you for the feedback, Knut Anders.
Attaching new revision of the release notes where the suggested changes have been addressed.
Kristian Waagan made changes - 15/Dec/08 01:40 PM
Patch 2a fixes the typo in the error message. The XML file and 4 translation files are touched.
Kristian Waagan made changes - 15/Dec/08 01:43 PM
Committed patch 1a to trunk with revision 726695.
Kristian Waagan made changes - 15/Dec/08 01:48 PM
Thanks for the updated release note. It looks good to me.
Issue has been fixed.
Thanks for the feedback on the release notes, Knut Anders.
Kristian Waagan made changes - 05/Jan/09 11:30 AM
Release note attached and the issue has been fixed. Closing.
Kristian Waagan made changes - 08/Jan/09 11:32 AM
Myrna van Lunteren made changes - 04/May/09 06:22 PM
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If we throw exceptions for length+2 and up, I think it's reasonable to throw an exception for length+1 as well, even though the wording in the spec is a bit unclear. Do we have any other alternatives?