[
https://issues.apache.org/jira/browse/DERBY-4245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kristian Waagan updated DERBY-4245:
-----------------------------------
Attachment: derby-4245-0a-preview.diff
Patch 0a is a preview patch.
I found two problems when investigating the bug;
- SQLClob incorrectly assumes that the instance variable SQLChar.stream always
reference the passed in stream to readExternal.
This is just wrong, and is what causes the NPE.
- LimitInputStream does not support mark/reset.
In the case of LimitInputStream, the underlying BufferedInputStream supports
mark/reset. In this cause we read 5 bytes, resets and skips two bytes. This
causes the limit stream to believe it can only deliver 59998 bytes, whereas the
correct number is 60003 (full length minus header length). The five bytes
involved in the mark/reset are "lost".
I'm not yet sure how to handle mark/reset with the limit reader.
I plan to address the problems in SQLClob under this issue, and create a
sub-issue for the limit stream.
The repro passes with the preview patch, and because mark/reset isn't used much
it may also pass the regression tests (the fix for LimitInputStream is broken).
I'm starting the regression tests now, will report back with the results.
> Sorting a table containing a CLOB fails after upgrade to 10.5
> -------------------------------------------------------------
>
> Key: DERBY-4245
> URL: https://issues.apache.org/jira/browse/DERBY-4245
> Project: Derby
> Issue Type: Bug
> Components: Store
> Affects Versions: 10.5.1.1
> Reporter: Knut Anders Hatlen
> Assignee: Kristian Waagan
> Attachments: derby-4245-0a-preview.diff, MixedVersionClob.java
>
>
> When sorting a table containing a CLOB column in a database that has been
> soft-upgraded from 10.4.2.0 to 10.5.1.1, the query fails with a
> NullPointerException.
> Reported on derby-user:
> http://mail-archives.apache.org/mod_mbox/db-derby-user/200905.mbox/%[email protected]%3e
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.