db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r759153 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
Date Fri, 27 Mar 2009 14:36:19 GMT
Author: kristwaa
Date: Fri Mar 27 14:36:19 2009
New Revision: 759153

URL: http://svn.apache.org/viewvc?rev=759153&view=rev
Log:
DERBY-4122: ClassCastException in SQLClob when running in soft upgrade mode (10.4.2.0 ->
10.5.1.0).
Fixes incorrect positioning of the stream after investigating the stream header (this doesn't
fix the ClassCastException). The positioning bug is also only
seen when processing streams with a pre 10.5 header, which may happen both in
soft upgrade and hard upgraded mode. It will not happen in a newly created
10.5 database.

Patch file: derby-4122-1a-incorrect_stream_positioning.diff

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java?rev=759153&r1=759152&r2=759153&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java Fri Mar 27 14:36:19
2009
@@ -334,8 +334,8 @@
                 HeaderInfo hdrInfo = investigateHeader(header, read);
                 if (read > hdrInfo.headerLength()) {
                     // We have read too much. Reset the stream.
-                    ((Resetable)stream).resetStream();
-                    read = 0;
+                    read = hdrInfo.headerLength();
+                    rewindStream(read);
                 }
                 csd = new CharacterStreamDescriptor.Builder().stream(stream).
                     bufferable(false).positionAware(false).



Mime
View raw message