db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r1304843 - /db/derby/code/branches/10.6/java/engine/org/apache/derby/iapi/types/SQLClob.java
Date Sat, 24 Mar 2012 16:19:08 GMT
Author: mikem
Date: Sat Mar 24 16:19:08 2012
New Revision: 1304843

URL: http://svn.apache.org/viewvc?rev=1304843&view=rev
Log:
DERBY-4544: Don't use the SQLClob.getLength() optimization on non-resetable streams--this
fixes a data corruption.

backport change #1091172 from 10.8 branch to 10.7.  The new tests depended on hibernate stream
classes in the
main source code (not just test classses) not
in 10.6, so just backported the fix.  Reviewed change in 10.6 context and verified it still
applies in 10.6.


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

Modified: db/derby/code/branches/10.6/java/engine/org/apache/derby/iapi/types/SQLClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.6/java/engine/org/apache/derby/iapi/types/SQLClob.java?rev=1304843&r1=1304842&r2=1304843&view=diff
==============================================================================
--- db/derby/code/branches/10.6/java/engine/org/apache/derby/iapi/types/SQLClob.java (original)
+++ db/derby/code/branches/10.6/java/engine/org/apache/derby/iapi/types/SQLClob.java Sat Mar
24 16:19:08 2012
@@ -268,6 +268,12 @@ public class SQLClob
         if (stream == null) {
             return super.getLength();
         }
+        //
+        // The following check was put in to fix DERBY-4544. We seem to get
+        // confused if we have to re-use non-resetable streams.
+        //
+        if ( !(stream instanceof Resetable) ) { return super.getLength(); }
+        
         // The Clob is represented as a stream.
         // Make sure we have a stream descriptor.
         boolean repositionStream = (csd != null);



Mime
View raw message