Attached is a small patch that does the following two things:

1) Changes the "lang/holdCursorIJ.sql" and "lang/scrollCursors1.sql" tests to clean up after each test case (by closing any opened cursors). Without this cleanup, some later versions of JCC can show false failures for these two tests.

2) Adds a "sed" filter to the harness that will filter out some unwanted JCC text that can be appended to certain error messages. This text isn't related to the actual errors in question and thus looks to be irrelevant. By filtering it out, we can avoid some false failures that can occur with later versions of JCC.

Could a committer please commit?

Thanks,
Army
Index: 
java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql
    (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1.sql
    (working copy)
@@ -233,6 +233,7 @@
 update t1 set i = 666 where i = 2;
 first c1;
 rollback;
+close c1;
 
 -- verify that statement cache works
 -- correctly with scroll and forward only
Index: 
java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql  
    (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql  
    (working copy)
@@ -34,6 +34,10 @@
 close jdk4;
 next jdk4;
 
+-- clean up.
+close jdk1;
+close jdk2;
+
 -- second test - make sure that all the cursors (including holdability true)
 -- have their resultsets closed after rollback.
 
@@ -56,6 +60,11 @@
 next jdk2;
 next jdk4;
 
+-- clean up.
+close jdk1;
+close jdk2;
+close jdk4;
+
 -- third test - Define a hold cursor on a table. Shouldn't be able to drop that
 -- table before & after commit. Have to close the cursor before table can be 
dropped.

@@ -74,6 +83,9 @@
 close jdk4;
 drop table t1;
 
+-- clean up.
+close jdk1;
+
 -- recreate and populate the table for next test
 create table t1(c11 int, c12 int);
 insert into t1 values(1,1);
@@ -98,6 +110,9 @@
 close jdk4;
 set isolation to serializable;
 
+-- clean up.
+close jdk1;
+
 -- fifth test - try isolation level change alongwith changing the isolation
 -- level of just one statement
 get with hold cursor jdk4 as 'SELECT * FROM t1';
@@ -113,6 +128,9 @@
 set isolation READ UNCOMMITTED;
 set isolation RS;
 
+-- clean up.
+close jdk1;
+
 -- sixth test - try positioned update with hold cursor
 get with hold cursor jdk4 as 'SELECT * FROM t1 FOR UPDATE';
 -- following should give error because cursor is not positioned on any row
@@ -186,5 +204,8 @@
 next scrollCursor;
 update t1 set c12=c12+1 where current of scrollCursor;
 
+-- clean up.
+close scrollCursor;
 
 
+
Index: java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java 
(revision 164154)
+++ java/testing/org/apache/derbyTesting/functionTests/harness/Sed.java 
(working copy)
@@ -178,6 +178,10 @@
                //Filter to suppress absould paths in error message for roll 
forward recovery tests 
                searchStrings.addElement("Directory.*.wombat.already.exists");
 
+        // Filter for "DB2ConnectionCorrelator" text that can be printed as
+        // part of some JCC error messages.
+        searchStrings.addElement("  DB2ConnectionCorrelator: [0-9A-Z.]*");
+
         Vector subStrings = new Vector();
         subStrings.addElement("");
         subStrings.addElement("");
@@ -222,6 +226,8 @@
                        subStrings.addElement("-----");
                }
                subStrings.addElement("Directory DBLOCATION/wombat already 
exists");
+               // ignore the 'DB2ConnectionCorrelator' thing altogether.
+               subStrings.addElement("");
                doWork(srcFile, dstFile, null, deleteLines, searchStrings, 
subStrings, isSed, isI18N);
 
        }
Index: 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
       (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/scrollCursors1.out
       (working copy)
@@ -408,6 +408,7 @@
 -----
 2          
 ij> rollback;
+ij> close c1;
 ij> -- verify that statement cache works
 ----- correctly with scroll and forward only
 ----- cursors on same query text
@@ -561,7 +562,7 @@
 1                                                                              
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                 
 -----
 Statement Name: 
-       SQL_CURSH200C3
+       SQL_CURSH200C2
 Statement Text: 
        select * from t1
 Parse Time: 0
Index: 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorIJ.out
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorIJ.out
 (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/holdCursorIJ.out
 (working copy)
@@ -45,6 +45,9 @@
 ij> close jdk4;
 ij> next jdk4;
 IJ ERROR: Unable to establish cursor
+ij> -- clean up.
+close jdk1;
+ij> close jdk2;
 ij> -- second test - make sure that all the cursors (including holdability 
true)
 ----- have their resultsets closed after rollback.
 ----- declare the cursors again, this time, try with rollback
@@ -74,6 +77,10 @@
 ERROR (no SQLState): Invalid operation: result set closed
 ij> next jdk4;
 ERROR (no SQLState): Invalid operation: result set closed
+ij> -- clean up.
+close jdk1;
+ij> close jdk2;
+ij> close jdk4;
 ij> -- third test - Define a hold cursor on a table. Shouldn't be able to drop 
that
 ----- table before & after commit. Have to close the cursor before table can 
be dropped.
 get with nohold cursor jdk1 as 'SELECT * FROM t1';
@@ -97,6 +104,8 @@
 close jdk4;
 ij> drop table t1;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- recreate and populate the table for next test
 create table t1(c11 int, c12 int);
 0 rows inserted/updated/deleted
@@ -127,6 +136,8 @@
 close jdk4;
 ij> set isolation to serializable;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- fifth test - try isolation level change alongwith changing the isolation
 ----- level of just one statement
 get with hold cursor jdk4 as 'SELECT * FROM t1';
@@ -151,11 +162,13 @@
 0 rows inserted/updated/deleted
 ij> set isolation RS;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- sixth test - try positioned update with hold cursor
 get with hold cursor jdk4 as 'SELECT * FROM t1 FOR UPDATE';
 ij> -- following should give error because cursor is not positioned on any row
 update t1 set c12=12 where current of jdk4;
-ERROR XCL08: Cursor 'SQL_CURSH200C2' is not on a row.
+ERROR XCL08: Cursor 'SQL_CURSH200C1' is not on a row.
 ij> select * from t1;
 C11 |C12        
 -----
@@ -205,7 +218,7 @@
 get with hold cursor jdk4 as 'SELECT * FROM t1 FOR UPDATE';
 ij> -- following should give error because cursor is not positioned on any row
 delete from t1 where current of jdk4;
-ERROR XCL08: Cursor 'SQL_CURSH200C2' is not on a row.
+ERROR XCL08: Cursor 'SQL_CURSH200C1' is not on a row.
 ij> select * from t1;
 C11 |C12        
 -----
@@ -297,4 +310,6 @@
 1 |1          
 ij> update t1 set c12=c12+1 where current of scrollCursor;
 1 row inserted/updated/deleted
+ij> -- clean up.
+close scrollCursor;
 ij> 
Index: 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/scrollCursors1.out
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/scrollCursors1.out
 (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/scrollCursors1.out
 (working copy)
@@ -408,6 +408,7 @@
 -----
 2          
 ij> rollback;
+ij> close c1;
 ij> -- verify that statement cache works
 ----- correctly with scroll and forward only
 ----- cursors on same query text
@@ -561,7 +562,7 @@
 1                                                                              
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                 
 -----
 Statement Name: 
-       SQL_CURLH000C3
+       SQL_CURLH000C2
 Statement Text: 
        select * from t1
 Parse Time: 0
Index: 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/holdCursorIJ.out
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/holdCursorIJ.out
   (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/holdCursorIJ.out
   (working copy)
@@ -45,6 +45,9 @@
 ij> close jdk4;
 ij> next jdk4;
 IJ ERROR: Unable to establish cursor
+ij> -- clean up.
+close jdk1;
+ij> close jdk2;
 ij> -- second test - make sure that all the cursors (including holdability 
true)
 ----- have their resultsets closed after rollback.
 ----- declare the cursors again, this time, try with rollback
@@ -74,6 +77,10 @@
 ERROR (no SQLState): Invalid operation: result set closed
 ij> next jdk4;
 ERROR (no SQLState): Invalid operation: result set closed
+ij> -- clean up.
+close jdk1;
+ij> close jdk2;
+ij> close jdk4;
 ij> -- third test - Define a hold cursor on a table. Shouldn't be able to drop 
that
 ----- table before & after commit. Have to close the cursor before table can 
be dropped.
 get with nohold cursor jdk1 as 'SELECT * FROM t1';
@@ -97,6 +104,8 @@
 close jdk4;
 ij> drop table t1;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- recreate and populate the table for next test
 create table t1(c11 int, c12 int);
 0 rows inserted/updated/deleted
@@ -127,6 +136,8 @@
 close jdk4;
 ij> set isolation to serializable;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- fifth test - try isolation level change alongwith changing the isolation
 ----- level of just one statement
 get with hold cursor jdk4 as 'SELECT * FROM t1';
@@ -151,11 +162,13 @@
 0 rows inserted/updated/deleted
 ij> set isolation RS;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- sixth test - try positioned update with hold cursor
 get with hold cursor jdk4 as 'SELECT * FROM t1 FOR UPDATE';
 ij> -- following should give error because cursor is not positioned on any row
 update t1 set c12=12 where current of jdk4;
-ERROR XCL08: Cursor 'SQL_CURLH000C7' is not on a row.
+ERROR XCL08: Cursor 'SQL_CURLH000C1' is not on a row.
 ij> select * from t1;
 C11 |C12        
 -----
@@ -205,7 +218,7 @@
 get with hold cursor jdk4 as 'SELECT * FROM t1 FOR UPDATE';
 ij> -- following should give error because cursor is not positioned on any row
 delete from t1 where current of jdk4;
-ERROR XCL08: Cursor 'SQL_CURLH000C7' is not on a row.
+ERROR XCL08: Cursor 'SQL_CURLH000C1' is not on a row.
 ij> select * from t1;
 C11 |C12        
 -----
@@ -297,4 +310,6 @@
 1 |1          
 ij> update t1 set c12=c12+1 where current of scrollCursor;
 1 row inserted/updated/deleted
+ij> -- clean up.
+close scrollCursor;
 ij> 
Index: 
java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out
===================================================================
--- 
java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out    
    (revision 164154)
+++ 
java/testing/org/apache/derbyTesting/functionTests/master/scrollCursors1.out    
    (working copy)
@@ -408,6 +408,7 @@
 -----------
 2          
 ij> rollback;
+ij> close c1;
 ij> -- verify that statement cache works
 -- correctly with scroll and forward only
 -- cursors on same query text
Index: 
java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out  
(revision 164154)
+++ java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out  
(working copy)
@@ -45,6 +45,9 @@
 ij> close jdk4;
 ij> next jdk4;
 IJ ERROR: Unable to establish cursor
+ij> -- clean up.
+close jdk1;
+ij> close jdk2;
 ij> -- second test - make sure that all the cursors (including holdability 
true)
 -- have their resultsets closed after rollback.
 -- declare the cursors again, this time, try with rollback
@@ -74,6 +77,10 @@
 ERROR XCL16: ResultSet not open, operation 'next' not permitted. Verify that 
autocommit is OFF.
 ij> next jdk4;
 ERROR XCL16: ResultSet not open, operation 'next' not permitted. Verify that 
autocommit is OFF.
+ij> -- clean up.
+close jdk1;
+ij> close jdk2;
+ij> close jdk4;
 ij> -- third test - Define a hold cursor on a table. Shouldn't be able to drop 
that
 -- table before & after commit. Have to close the cursor before table can be 
dropped.
 get with nohold cursor jdk1 as 'SELECT * FROM t1';
@@ -97,6 +104,8 @@
 close jdk4;
 ij> drop table t1;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- recreate and populate the table for next test
 create table t1(c11 int, c12 int);
 0 rows inserted/updated/deleted
@@ -127,6 +136,8 @@
 close jdk4;
 ij> set isolation to serializable;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- fifth test - try isolation level change alongwith changing the isolation
 -- level of just one statement
 get with hold cursor jdk4 as 'SELECT * FROM t1';
@@ -151,6 +162,8 @@
 0 rows inserted/updated/deleted
 ij> set isolation RS;
 0 rows inserted/updated/deleted
+ij> -- clean up.
+close jdk1;
 ij> -- sixth test - try positioned update with hold cursor
 get with hold cursor jdk4 as 'SELECT * FROM t1 FOR UPDATE';
 ij> -- following should give error because cursor is not positioned on any row
@@ -297,4 +310,6 @@
 1          |1          
 ij> update t1 set c12=c12+1 where current of scrollCursor;
 ERROR 24000: Invalid cursor state - no current row.
+ij> -- clean up.
+close scrollCursor;
 ij> 

Reply via email to