db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r771613 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
Date Tue, 05 May 2009 08:06:53 GMT
Author: kahatlen
Date: Tue May  5 08:06:53 2009
New Revision: 771613

URL: http://svn.apache.org/viewvc?rev=771613&view=rev
Log:
DERBY-4212: Prepared statement with OFFSET/FETCH gives different results on subsequent execute

Added a test case to OffsetFetchNextTest (disabled for now).

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java?rev=771613&r1=771612&r2=771613&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/OffsetFetchNextTest.java
Tue May  5 08:06:53 2009
@@ -646,6 +646,21 @@
         stm.close();
     }
 
+    /**
+     * Test that the values of offset and fetch first are not forgotten if
+     * a {@code PreparedStatement} is executed multiple times (DERBY-4212).
+     * <b>NOTE:</b> Disabled until the bug is fixed. Remove x from the method
+     * name to enable it.
+     */
+    public void xtestRepeatedExecution() throws SQLException {
+        PreparedStatement ps = prepareStatement(
+                "select * from t1 order by b " +
+                "offset 2 rows fetch next 2 rows only");
+        String[][] expected = {{"1", "3"}, {"1", "4"}};
+        for (int i = 0; i < 10; i++) {
+            JDBC.assertFullResultSet(ps.executeQuery(), expected);
+        }
+    }
 
     private void queryAndCheck(
         Statement stm,



Mime
View raw message