Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 50496 invoked from network); 10 Feb 2010 16:13:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Feb 2010 16:13:05 -0000 Received: (qmail 64999 invoked by uid 500); 10 Feb 2010 16:13:05 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 64929 invoked by uid 500); 10 Feb 2010 16:13:04 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 64920 invoked by uid 99); 10 Feb 2010 16:13:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 16:13:04 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2010 16:13:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 44D4323888E8; Wed, 10 Feb 2010 16:12:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: derby-commits@db.apache.org From: dag@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100210161241.44D4323888E8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(" +