|
[
Permalink
| « Hide
]
Kristian Waagan added a comment - 17/Feb/09 08:15 AM
This issue is present for both Blob and Clob, and also in the client driver.
Kristian Waagan made changes - 17/Feb/09 08:15 AM
Kristian Waagan made changes - 20/Feb/09 08:38 AM
Kristian Waagan made changes - 26/Feb/09 09:16 AM
The patch 'derby-4060-1a-sub_stream_fix.diff' fixes the reported bug.
The changes in the production code consist of subtracting one from the position when checking against the length. Using the example from the report; o current: 11 + 10 > 20 = true (exception thrown) o with patch: (11 -1) + 10 > 20 = false (check passes) I made some more changes to the test code. Three tests were added, one for Blob and two for Clob (one Clob loaded with latin chars only, one loaded with CJK chars). In addition, CharAlphabet-objects cannot be shared between readers. I dealt with this by adding getClone method to the CharAlphabet-class, and getting a clone when creating the LoopingAlphabetReader. This should maybe be changed in a more robust way. It should also be noted that the method draining the stream and returning the last byte/char, performs more checks than usual. Patch ready for review.
Kristian Waagan made changes - 26/Feb/09 11:44 AM
Kristian Waagan made changes - 26/Feb/09 11:54 AM
Attached an updated patch, adding two more comments.
Kristian Waagan made changes - 02/Mar/09 08:48 AM
Committed patch 1b to trunk with revision 749235.
Kristian Waagan made changes - 02/Mar/09 08:49 AM
The fix seems to merge cleanly with both 10.4 and 10.3 (I haven't run tests yet).
I'll wait for a few days to see if any comments or problems show up, and if not I'll backport the fix.
Kristian Waagan made changes - 02/Mar/09 09:05 AM
Should we also update the javadoc comments in EmbedBlob and EmbedClob (they still say that we throw SQLException if pos+length is greater than the number of bytes/characters)?
Same goes for the error message (XJ087.S) which says "Sum of position('{0}') and length('{1}') is greater than the size of the LOB." Thank you for the comment, Knut Anders.
Patch 2a changes the JavaDoc and the error message. Feel free to comment on the wording. I plan to commit this on Monday. Patch ready for review.
Kristian Waagan made changes - 04/Mar/09 11:02 AM
The patch looks good to me. (I was wondering what we should do with the translations, but it appears that we are only required to do something if the message parameters are changed, see comment near the top of messages.xml. For now it's probably better to leave the (possibly inaccurate) translated messages than to remove them.)
Backported patch 1b to 10.4 with revision 750409 and to 10.3 with revision 750410.
Kristian Waagan made changes - 05/Mar/09 10:29 AM
Committed patch 2a to trunk with revision 751637.
Backported to 10.4 and 10.3 with revisions 751639 and 751640. This concludes my work on this issue.
Kristian Waagan made changes - 09/Mar/09 09:54 AM
Myrna van Lunteren made changes - 04/May/09 06:21 PM
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||