db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krist...@apache.org
Subject svn commit: r790162 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobSortTest.java
Date Wed, 01 Jul 2009 13:46:49 GMT
Author: kristwaa
Date: Wed Jul  1 13:46:49 2009
New Revision: 790162

URL: http://svn.apache.org/viewvc?rev=790162&view=rev
Log:
DERBY-4245: Sorting a table containing a CLOB fails after upgrade to 10.5.
Lowered the sort buffer to the minimum (through derby.storage.sortBufferMax),
and the number of rows inserted in the test.

Patch file: derby-4245-4a-adjust_sort_buffer_test.diff


Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobSortTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobSortTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobSortTest.java?rev=790162&r1=790161&r2=790162&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobSortTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/LobSortTest.java
Wed Jul  1 13:46:49 2009
@@ -26,6 +26,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import java.util.Properties;
 import java.util.Random;
 
 import junit.framework.Test;
@@ -36,6 +37,7 @@
 import org.apache.derbyTesting.functionTests.util.streams.LoopingAlphabetStream;
 import org.apache.derbyTesting.junit.BaseJDBCTestCase;
 import org.apache.derbyTesting.junit.CleanDatabaseTestSetup;
+import org.apache.derbyTesting.junit.SystemPropertyTestSetup;
 
 /**
  * Executes sorting of LOB values based on the length of the LOB or a random
@@ -195,9 +197,13 @@
     }
 
     public static Test suite() {
+        Properties props = new Properties();
+        // Adjust sort buffer size to trigger the bug situation with less data.
+        props.setProperty("derby.storage.sortBufferMax", "4");
         TestSuite suite = new TestSuite(LobSortTest.class,
                                         "LobSortTestEmbedded");
-        return new CleanDatabaseTestSetup(suite) {
+        return new CleanDatabaseTestSetup(
+                new SystemPropertyTestSetup(suite, props, true)) {
             /**
              * Generates a table with Blob and Clobs of mixed size.
              */
@@ -217,7 +223,7 @@
                 ps.setInt(4, 0);
                 ps.setInt(5, rnd.nextInt());
                 ps.executeUpdate();
-                for (int i=0; i < 600; i++) {
+                for (int i=0; i < 100; i++) {
                     CharAlphabet ca = getCharAlphabet(1 + rnd.nextInt(3));
                     int length = (int)(rnd.nextDouble() * 64.0 * 1024.0);
                     if (rnd.nextInt(1000) < 500) {



Mime
View raw message