You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by my...@apache.org on 2010/09/03 18:42:09 UTC

svn commit: r992365 - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ master/DerbyNetClient/ suites/ tests/lang/

Author: myrnavl
Date: Fri Sep  3 16:42:08 2010
New Revision: 992365

URL: http://svn.apache.org/viewvc?rev=992365&view=rev
Log:
DERBY-3801; Convert org.apache.derbyTesting.functionTests.tests.lang.holdCursorIJ.sql to junit
  converted by placing the script in LangScripts to be run as ij-junit test.
  sections of the .sql scripts that previously showed diffs between embedded and
    network server/client have been resolved either by fixing the differences, 
    by removing when other tests were found to be testing the same, or in one  
    instance, by commenting out with a reference to the bug. 

Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/holdCursorIJ.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ_app.properties
Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out?rev=992365&r1=992364&r2=992365&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/holdCursorIJ.out Fri Sep  3 16:42:08 2010
@@ -26,6 +26,7 @@ ij> -- set autocommit off
 autocommit off;
 ij> -- first test - make sure that only cursors created with holdability true
 -- have open resultsets after commit
+
 -- declare 3 different kind of cursors one for each jdbc release so far
 get with nohold cursor jdk1 as 'SELECT * FROM t1';
 ij> get scroll insensitive with nohold cursor jdk2 as 'SELECT * FROM t1';
@@ -66,6 +67,7 @@ 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
 get with nohold cursor jdk1 as 'SELECT * FROM t1';
 ij> get scroll insensitive with nohold cursor jdk2 as 'SELECT * FROM t1';
@@ -97,34 +99,8 @@ 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';
-ij> get with hold cursor jdk4 as 'SELECT * FROM t1';
-ij> next jdk1;
-C11        |C12        
------------------------
-1          |1          
-ij> next jdk4;
-C11        |C12        
------------------------
-1          |1          
-ij> -- wont' be able to drop table because of cursors jdk1 and jdk4
--- in DerbyNetClient, cursor is closed on server and DROP TABLE succeeds
-drop table t1;
-ERROR X0X95: Operation 'DROP TABLE' cannot be performed on object 'T1' because there is an open ResultSet dependent on that object.
-ij> commit;
-ij> -- drop table still won't work because jdk4 is still open after commit
--- in DerbyNetClient, the table is already dropped
-drop table t1;
-ERROR X0X95: Operation 'DROP TABLE' cannot be performed on object 'T1' because there is an open ResultSet dependent on that object.
-ij> -- close cursor jdk4 and try then deleting the table
--- in DerbyNetClient, the table is already dropped
-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
@@ -144,16 +120,10 @@ ij> next jdk4;
 C11        |C12        
 -----------------------
 1          |1          
-ij> -- try to change the isolation level. will give error because of jdk1 and jdk4
--- no error in DerbyNetClient because cursor is closed on server
-set current isolation RR;
-ERROR X0X03: Invalid transaction state - held cursor requires same isolation level
-ij> commit;
-ij> -- attempt to change isolation level should give error because of jdk4 hold cursor
--- no error in DerbyNetClient because cursor is closed on server
-set isolation = REPEATABLE READ;
-ERROR X0X03: Invalid transaction state - held cursor requires same isolation level
-ij> -- close jdk4 and then should be able to change isolation
+ij> -- changing isolation while cursor is open would fail; 
+-- but for client/server, with small data set, the server would already be
+-- closed. See discussion re DERBY-3801.
+-- close jdk4 and then should be able to change isolation
 close jdk4;
 ij> set isolation to serializable;
 0 rows inserted/updated/deleted
@@ -171,14 +141,6 @@ ij> next jdk1;
 C11        |C12        
 -----------------------
 1          |1          
-ij> -- following should fail because of cursor jdk4
--- no error in DerbyNetClient because cursor is closed on server
-set isolation RS;
-ERROR X0X03: Invalid transaction state - held cursor requires same isolation level
-ij> -- following should fail because of cursor jdk4
--- no error in DerbyNetClient because cursor is closed on server
-set isolation UR;
-ERROR X0X03: Invalid transaction state - held cursor requires same isolation level
 ij> close jdk4;
 ij> -- should be able to change the isolation now
 set isolation READ UNCOMMITTED;
@@ -325,16 +287,18 @@ ij> commit;
 ij> close jdk4;
 ij> -- tenth test - bug 4515 - have a more useful message
 -- update where current of fails in autocommit=true, held open cursor
+
 autocommit on;
 ij> get with hold cursor scrollCursor as 'select * from t1 for update of c12';
 ij> next scrollCursor;
 C11        |C12        
 -----------------------
 1          |1          
-ij> update t1 set c12=c12+1 where current of scrollCursor;
-ERROR 24000: Invalid cursor state - no current row.
-ij> -- clean up.
+ij> -- commented out for DERBY-4778
+-- update t1 set c12=c12+1 where current of scrollCursor;
+
+-- clean up.
 close scrollCursor;
 ij> drop table t1;
 0 rows inserted/updated/deleted
-ij> 
+ij> 
\ No newline at end of file

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall?rev=992365&r1=992364&r2=992365&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall Fri Sep  3 16:42:08 2010
@@ -10,7 +10,6 @@ lang/ddlTableLockMode.sql
 lang/desc_index.sql
 lang/emptyStatistics.sql
 lang/fk_nonSPS.sql
-lang/holdCursorIJ.sql
 lang/infostreams.sql
 lang/isolationLevels.sql
 lang/joinDeadlock.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall?rev=992365&r1=992364&r2=992365&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbynetmats.runall Fri Sep  3 16:42:08 2010
@@ -2,5 +2,4 @@ derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
 derbynet/DerbyNetAutoStart.java
 derbynet/testProtocol.java
-lang/holdCursorIJ.sql
 lang/wisconsin.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall?rev=992365&r1=992364&r2=992365&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/j9derbynetmats.runall Fri Sep  3 16:42:08 2010
@@ -1,3 +1,2 @@
 derbynet/dblook_test_net.java
 derbynet/dblook_test_net_territory.java
-lang/holdCursorIJ.sql

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java?rev=992365&r1=992364&r2=992365&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/LangScripts.java Fri Sep  3 16:42:08 2010
@@ -53,6 +53,7 @@ public final class LangScripts extends S
         "bit",
         "bit2",
         "stringtypes",
+        "holdCursorIJ"
         };
     
     /**

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql?rev=992365&r1=992364&r2=992365&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/holdCursorIJ.sql Fri Sep  3 16:42:08 2010
@@ -81,30 +81,8 @@ 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.
-
-get with nohold cursor jdk1 as 'SELECT * FROM t1';
-get with hold cursor jdk4 as 'SELECT * FROM t1';
-next jdk1;
-next jdk4;
--- wont' be able to drop table because of cursors jdk1 and jdk4
--- in DerbyNetClient, cursor is closed on server and DROP TABLE succeeds
-drop table t1;
-commit;
-
--- drop table still won't work because jdk4 is still open after commit
--- in DerbyNetClient, the table is already dropped
 drop table t1;
 
--- close cursor jdk4 and try then deleting the table
--- in DerbyNetClient, the table is already dropped
-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);
@@ -117,16 +95,9 @@ get with hold cursor jdk4 as 'SELECT * F
 next jdk1;
 next jdk4;
 
--- try to change the isolation level. will give error because of jdk1 and jdk4
--- no error in DerbyNetClient because cursor is closed on server
-set current isolation RR;
-
-commit;
-
--- attempt to change isolation level should give error because of jdk4 hold cursor
--- no error in DerbyNetClient because cursor is closed on server
-set isolation = REPEATABLE READ;
-
+-- changing isolation while cursor is open would fail; 
+-- but for client/server, with small data set, the server would already be
+-- closed. See discussion re DERBY-3801.
 -- close jdk4 and then should be able to change isolation
 close jdk4;
 set isolation to serializable;
@@ -140,12 +111,6 @@ get with hold cursor jdk4 as 'SELECT * F
 get with nohold cursor jdk1 as 'SELECT * FROM t1 WITH CS';
 next jdk4;
 next jdk1;
--- following should fail because of cursor jdk4
--- no error in DerbyNetClient because cursor is closed on server
-set isolation RS;
--- following should fail because of cursor jdk4
--- no error in DerbyNetClient because cursor is closed on server
-set isolation UR;
 close jdk4;
 -- should be able to change the isolation now
 set isolation READ UNCOMMITTED;
@@ -225,7 +190,8 @@ close jdk4;
 autocommit on;
 get with hold cursor scrollCursor as 'select * from t1 for update of c12';
 next scrollCursor;
-update t1 set c12=c12+1 where current of scrollCursor;
+-- commented out for DERBY-4778
+-- update t1 set c12=c12+1 where current of scrollCursor;
 
 -- clean up.
 close scrollCursor;