db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r389202 [2/2] - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/sql/execute/ engine/org/apache/derby/iapi/store/access/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/impl/sql/execute/ engine/org/apache/derby/impl/sto...
Date Mon, 27 Mar 2006 17:16:30 GMT
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/updatableResultSet.out
Mon Mar 27 09:16:22 2006
@@ -1,29 +1,25 @@
 Start testing delete and update using JDBC2.0 updateable resultset apis
 Negative Testl - request for scroll insensitive updatable resultset will give a read only
scroll insensitive resultset
-WARNING 01J03: Scroll sensitive and scroll insensitive updatable ResultSets are not currently
implemented.
 requested TYPE_SCROLL_INSENSITIVE, CONCUR_UPDATABLE but that is not supported
 Make sure that we got TYPE_SCROLL_INSENSITIVE? true
-Make sure that we got CONCUR_READ_ONLY? true
-ownDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+Make sure that we got CONCUR_READ_ONLY? false
+ownDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? true
 othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
-deletesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+deletesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE)? true
 JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable
resultset
-SQL State : XJ083
-Got expected exception 'deleteRow' not allowed because the ResultSet is not an updatable
ResultSet. 
-SQL State : XJ083
-Got expected exception 'updateRow' not allowed because the ResultSet is not an updatable
ResultSet. 
+FAIL!!! deleteRow should have failed because Derby does not yet support scroll insensitive
updatable resultsets
+SQL State : 24000
+Got expected exception Invalid cursor state - no current row.
 Negative Test2 - request for scroll sensitive updatable resultset will give a read only scroll
insensitive resultset
 WARNING 01J02: Scroll sensitive cursors are not currently implemented.
-WARNING 01J03: Scroll sensitive and scroll insensitive updatable ResultSets are not currently
implemented.
 requested TYPE_SCROLL_SENSITIVE, CONCUR_UPDATABLE but that is not supported
 Jira issue Derby-154 : When client connects to Network Server using JCC, it incorrectly shows
support for scroll sensitive updatable resultsets
 Make sure that we got TYPE_SCROLL_INSENSITIVE? true
-Make sure that we got CONCUR_READ_ONLY? true
+Make sure that we got CONCUR_READ_ONLY? false
 JDBC 2.0 updatable resultset api will fail on this resultset because this is not an updatable
resultset
-SQL State : XJ083
-Got expected exception 'deleteRow' not allowed because the ResultSet is not an updatable
ResultSet. 
-SQL State : XJ083
-Got expected exception 'updateRow' not allowed because the ResultSet is not an updatable
ResultSet. 
+FAIL!!! deleteRow should have failed because Derby does not yet support scroll sensitive
updatable resultsets
+SQL State : 24000
+Got expected exception Invalid cursor state - no current row.
 Negative Test3 - request a read only resultset and attempt deleteRow and updateRow on it
 Make sure that we got CONCUR_READ_ONLY? true
 Now attempting to send a deleteRow on a read only resultset.
@@ -155,7 +151,7 @@
 column 2 on this deleted row is aa                  
 doing positioned delete again w/o first positioning the ResultSet on the next row will fail
 SQL State : XCL08
-Got expected exception Cursor 'SQLCUR4' is not on a row.
+Got expected exception Cursor 'SQLCUR6' is not on a row.
 Position the ResultSet with next()
 Should be able to do positioned delete on the current row now
 Positive Test1d - updatable resultset to do positioned update
@@ -306,7 +302,7 @@
 	{3,cc                  }
 Positive Test9c - try to updateXXX on a readonly column. Should get error
 SQL State : 42X31
-Got expected exception Column 'C2' is not in the FOR UPDATE list of cursor 'SQLCUR17'.
+Got expected exception Column 'C2' is not in the FOR UPDATE list of cursor 'SQLCUR19'.
 attempt to get an updatable resultset using correlation name for an readonly column. It should
work
 The sql is SELECT c1, c2 as col2 FROM t1 abcde FOR UPDATE of c1
 Table t1 after updateRow has following rows
@@ -317,7 +313,7 @@
 	{3,cc                  }
 Positive Test9d - try to updateXXX on a readonly column with correlation name. Should get
error
 SQL State : 42X31
-Got expected exception Column 'COL2' is not in the FOR UPDATE list of cursor 'SQLCUR19'.
+Got expected exception Column 'COL2' is not in the FOR UPDATE list of cursor 'SQLCUR21'.
 Table t1 has following rows
 	 C1,C2
 	 -- --
@@ -328,7 +324,7 @@
 delete using first resultset
 attempt to send deleteRow on the same row through a different resultset should throw an exception
 SQL State : XCL08
-Got expected exception Cursor 'SQLCUR21' is not on a row.
+Got expected exception Cursor 'SQLCUR23' is not on a row.
 Move to next row in the 2nd resultset and then delete using the second resultset
 Positive Test11 - setting the fetch size to > 1 will be ignored by updatable resultset.
Same as updatable cursors
 Notice the Fetch Size in run time statistics output.
@@ -2795,7 +2791,7 @@
 	{2,bb                  }
 	{3,cc                  }
 SQL State : 42X31
-Got expected exception Column 'C2' is not in the FOR UPDATE list of cursor 'SQLCUR39'.
+Got expected exception Column 'C2' is not in the FOR UPDATE list of cursor 'SQLCUR41'.
 updateRow passed
   Make sure the contents of table are unchanged
 	 C1,C2

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/DerbyNetClient.exclude
Mon Mar 27 09:16:22 2006
@@ -25,3 +25,4 @@
 largedata/LobLimits.java
 jdbc4/TestDbMetaData.java
 jdbc4/TestJDBC40Exception.java
+jdbcapi/SURTest.junit

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/SURQueryMixTest.java
Mon Mar 27 09:16:22 2006
@@ -235,12 +235,10 @@
                 con.createStatement().executeUpdate
                         ("DELETE FROM T1 WHERE CURRENT OF \"" + cursorName + 
                          "\"");
-                
-                rs.relative(0); // If this call is not here, the old values are
-                                // returned in rs.getXXX calls
             } else {
                 rs.deleteRow();
             }
+            rs.relative(0);
             println("Deleted row " + key);
             // Update the rows table
             rows.put(key, getRowString(rs));

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadata_test.java
Mon Mar 27 09:16:22 2006
@@ -670,6 +670,31 @@
 			System.out.println("othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
 			System.out.println("othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
 
+ 			System.out.println("Test the metadata calls related to visibility of *own* changes for
different resultset types");
+ 			System.out.println("ownUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? " + met.ownUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY));
+ 			System.out.println("ownDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? " + met.ownDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY));
+ 			System.out.println("ownInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY)? " + met.ownInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY));
+ 			System.out.println("Scroll insensitive ResultSet see updates and deletes, but not inserts");
+ 			System.out.println("ownUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.ownUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ 			System.out.println("ownDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.ownDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ 			System.out.println("ownInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.ownInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ 			System.out.println("Derby does not yet implement scroll sensitive resultsets and hence
following metadata calls return false");
+ 			System.out.println("ownUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.ownUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
+ 			System.out.println("ownDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.ownDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
+ 			System.out.println("ownInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
+ 
+ 			System.out.println("Test the metadata calls related to detectability of visible changes
for different resultset types");
+ 			System.out.println("Expect true for updates and deletes of TYPE_SCROLL_INSENSITIVE, all
others should be false");
+ 			System.out.println("updatesAreDetected(ResultSet.TYPE_FORWARD_ONLY)? " + met.updatesAreDetected(ResultSet.TYPE_FORWARD_ONLY));
+ 			System.out.println("deletesAreDetected(ResultSet.TYPE_FORWARD_ONLY)? " + met.deletesAreDetected(ResultSet.TYPE_FORWARD_ONLY));
+ 			System.out.println("insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY)? " + met.insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY));
+ 			System.out.println("updatesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.updatesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ 			System.out.println("deletesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.deletesAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ 			System.out.println("insertsAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.insertsAreDetected(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ 			System.out.println("updatesAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.updatesAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE));
+ 			System.out.println("deletesAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.deletesAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE));
+ 			System.out.println("insertsAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.insertsAreDetected(ResultSet.TYPE_SCROLL_SENSITIVE));
+            
 			if (!TestUtil.isJCCFramework()) { // gives false on all.. bug
 				int[] types = {ResultSet.TYPE_FORWARD_ONLY, 
 							   ResultSet.TYPE_SCROLL_INSENSITIVE,

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/resultset.java
Mon Mar 27 09:16:22 2006
@@ -224,9 +224,8 @@
 				System.out.println("getColumnTypeName("+i+"): "+met.getColumnTypeName(i));
 				System.out.println("isReadOnly("+i+"): "+met.isReadOnly(i));
 				boolean writable = met.isWritable(i);
-				// JCC Supports updatable resultsets so isWritable is true
-				if ((isDerbyNet && writable == true) ||
-					(!isDerbyNet && writable == false))
+				// JCC & Embedded driver support updatable resultsets so isWritable is true
+				if (writable == true)
 					System.out.println("isWritable("+i+"): Expected isWritable value");
 				System.out.println("isDefinitelyWritable("+i+"): "+met.isDefinitelyWritable(i));
 			}

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors2.java
Mon Mar 27 09:16:22 2006
@@ -609,7 +609,8 @@
 			System.out.println("cursor type = " + rs.getType() +
 							   ", not " + ResultSet.TYPE_SCROLL_INSENSITIVE);
 		}
-		if (rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY)
+		if ((rs.getConcurrency() != ResultSet.CONCUR_READ_ONLY) && 
+				isDerbyNetClient)
 		{
 			System.out.println("concurrency = " + rs.getConcurrency() +
 							   ", not " + ResultSet.CONCUR_READ_ONLY);
@@ -1200,7 +1201,8 @@
 		}
 		if (warningCount != 1)
 		{
-			System.out.println("warningCount expected to be 1, not " + warningCount);
+			System.out.println("warningCount expected to be 1, not " + 
+					warningCount);
 			passed = false;
 		}
 		conn.clearWarnings();
@@ -1220,11 +1222,17 @@
 			warning = warning.getNextWarning();
 			warningCount++;
 		}
-		if (warningCount != 2)
+		if (warningCount != 2 && isDerbyNetClient)
 		{
 			System.out.println("warningCount expected to be 2, not " + warningCount);
 			passed = false;
 		}
+		// Embedded implements SCROLL_INSENSITIVE and UPDATABLE
+		if (warningCount != 1 && !isDerbyNetClient)
+		{
+			System.out.println("warningCount expected to be 1, not " + warningCount);
+			passed = false;
+		}
 		conn.clearWarnings();
 		cs_s_u.close();	
 
@@ -1244,7 +1252,8 @@
 		}
 		if (warningCount != 0)
 		{
-			System.out.println("warningCount expected to be 0, not " + warningCount);
+			System.out.println("warningCount expected to be 0, not " + 
+					warningCount);
 			passed = false;
 		}
 		conn.clearWarnings();
@@ -1264,9 +1273,15 @@
 			warning = warning.getNextWarning();
 			warningCount++;
 		}
-		if (warningCount != 1)
+		if (warningCount != 1 && isDerbyNetClient)
 		{
 			System.out.println("warningCount expected to be 1, not " + warningCount);
+			passed = false;
+		}
+		// Embedded implements SCROLL_INSENSITIVE and UPDATABLE
+		if (warningCount != 0 && !isDerbyNetClient)
+		{
+			System.out.println("warningCount expected to be 0, not " + warningCount);
 			passed = false;
 		}
 		conn.clearWarnings();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java?rev=389202&r1=389201&r2=389202&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/updatableResultSet.java
Mon Mar 27 09:16:22 2006
@@ -642,6 +642,8 @@
 				System.out.println("Got expected exception " + e.getMessage());
 			}
 
+			reloadData();
+
 			System.out.println("Positive Test1a - request updatable resultset for forward only type
resultset");
 			stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
 			JDBCDisplayUtil.ShowWarnings(System.out, conn);



Mime
View raw message