db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r908563 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/execute/ testing/org/apache/derbyTesting/functionTests/tests/memory/
Date Wed, 10 Feb 2010 16:12:41 GMT
Author: dag
Date: Wed Feb 10 16:12:40 2010
New Revision: 908563

URL: http://svn.apache.org/viewvc?rev=908563&view=rev
Log:
DERBY-4477 Selecting / projecting a column whose value is represented by a stream more than
once fails

Patch derby-4477-useCloning: Uses the new stream cloning referred to
earlier as a coming follow-up for this issue: derby-4477-useCloning.

It also bumps the lob size in the lowmem suite's test cases added for
this issue in ClobMemTest and BlobMemTest, which will run out of
memory without this cloning used by this patch.

Note:

The "length-materialization optimization" (code that was commented out
earlier, and removed by the latest patch) hasn't been implemented
yet. However, we think it is better placed inside the various
cloneValue-methods and hope to get to it at a later time.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/BlobMemTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ClobMemTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java?rev=908563&r1=908562&r2=908563&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/ProjectRestrictResultSet.java
Wed Feb 10 16:12:40 2010
@@ -518,21 +518,9 @@
                 // See if the column has been marked for cloning.
                 // If the value isn't a stream, don't bother cloning it.
                 if (cloneMap[index] && dvd.getStream() != null) {
-
-                    // Enable this code after DERBY-3650 is in: FIXME
-                    //
-                    // long length = dvd.getLengthIfKnown();
-                    //
-                    // If the stream isn't clonable, we have to load the stream.
-                    // if ((length > 32*1024 || length == -1) &&
-                    //     dvd.getStream() instanceof CloneableStream) {
-                    //     // Copy the stream, the value may be large.
-                    //     dvd = dvd.copyForRead();
-                    // } else {
-                    //     // Load the stream, then we don't have to clone.
-                    ((StreamStorable)dvd).loadStream();
-                    // }
+                    dvd = dvd.cloneValue(false);
                 }
+
                 result.setColumn(index + 1, dvd);
 			}
 		}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/BlobMemTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/BlobMemTest.java?rev=908563&r1=908562&r2=908563&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/BlobMemTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/BlobMemTest.java
Wed Feb 10 16:12:40 2010
@@ -226,8 +226,7 @@
         setAutoCommit(false);
 
         Statement s = createStatement();
-        // int blobsize = LONG_BLOB_LENGTH;
-        int blobsize = 35000;
+        int blobsize = LONG_BLOB_LENGTH;
 
         s.executeUpdate(
             "CREATE TABLE T_MAIN(" +

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ClobMemTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ClobMemTest.java?rev=908563&r1=908562&r2=908563&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ClobMemTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memory/ClobMemTest.java
Wed Feb 10 16:12:40 2010
@@ -204,8 +204,7 @@
         setAutoCommit(false);
 
         Statement s = createStatement();
-        // int clobsize = LONG_BLOB_LENGTH;
-        int clobsize = 35000;
+        int clobsize = LONG_CLOB_LENGTH;
 
         s.executeUpdate(
             "CREATE TABLE T_MAIN(" +



Mime
View raw message