db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r734758 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLClob.java
Date Thu, 15 Jan 2009 17:04:18 GMT
Author: kristwaa
Date: Thu Jan 15 09:04:17 2009
New Revision: 734758

URL: http://svn.apache.org/viewvc?rev=734758&view=rev
Log:
DERBY-3907: Save useful length information for Clobs in store.
Fixed a bug where the stream could be out of sync with the descriptor.
Also corrected some indentation.
Patch file: derby-3907-6a-SQLClob_stream_descriptor_sync.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=734758&r1=734757&r2=734758&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 Thu Jan 15 09:04:17
2009
@@ -25,6 +25,7 @@
 
 import org.apache.derby.iapi.jdbc.CharacterStreamDescriptor;
 
+import org.apache.derby.iapi.services.io.InputStreamUtil;
 import org.apache.derby.iapi.services.io.StoredFormatIds;
 
 import org.apache.derby.iapi.services.sanity.SanityManager;
@@ -245,9 +246,11 @@
             if (stream instanceof Resetable) {
                 try {
                     ((Resetable)stream).resetStream();
-                    } catch (IOException ioe) {
-                        throwStreamingIOException(ioe);
-                    }
+                    // Make sure the stream is in sync with the descriptor.
+                    InputStreamUtil.skipFully(stream, csd.getCurBytePos());
+                } catch (IOException ioe) {
+                    throwStreamingIOException(ioe);
+                }
             } else {
                 if (SanityManager.DEBUG) {
                     SanityManager.THROWASSERT("Unable to reset stream when " +



Mime
View raw message