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 ka...@apache.org on 2006/03/20 15:21:10 UTC

svn commit: r387214 [3/3] - in /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests: master/ master/DerbyNet/ master/DerbyNetClient/ tests/jdbcapi/ tests/lang/

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java?rev=387214&r1=387213&r2=387214&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMetaDataJdbc30.java Mon Mar 20 06:20:56 2006
@@ -138,7 +138,12 @@
       dumpParameterMetaData(paramMetaData);
       ps.execute();
 
-      // variation, and also test out empty string in the escape (jira 44). 
+      // DERBY-44 added support for SELECT ... WHERE column LIKE ? ESCAPE ?
+      // This test case tests
+      //   a) that such a statement compiles, and
+      //   b) that we get the correct error message if the escape
+      //      sequence is an empty string (at one point this would
+      //      lead to a StringIndexOutOfBoundsException)
       System.out.println("variation 1, testing jira 44");
       ps = con.prepareStatement("select * from sys.systables where tablename like ? escape ?");
       ps.setString (1, "SYS%");
@@ -146,7 +151,17 @@
       paramMetaData = ps.getParameterMetaData();
       System.out.println("parameters count for prepared statement is " + paramMetaData.getParameterCount());
       dumpParameterMetaData(paramMetaData);
-      ps.execute();
+      try {
+          ResultSet rs = ps.executeQuery();
+          rs.next();
+          System.out.println("Jira 44 failed (didn't get SQLSTATE 22019)");
+          rs.close();
+      } catch (SQLException e) {
+          if (!"22019".equals(e.getSQLState())) {
+              System.out.println("Jira 44 failed.");
+              e.printStackTrace(System.out);
+          }
+      }
 
       // the test no longer tests 4552, but kept as an interesting test scenario 
       // bug 4552 - no parameters would be returned for execute statement using

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=387214&r1=387213&r2=387214&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 20 06:20:56 2006
@@ -780,6 +780,16 @@
 			return;
 		}
 
+		// This might look strange, but we want to know that the first
+		// call to next() is successful before we get meta data and
+		// display column headings. If a driver is pre-fetching data,
+		// an exception might be thrown in Statement.executeQuery(),
+		// but a driver without pre-fetching will not get the
+		// exception until ResultSet.next() is called (hence column
+		// headings are printed). With this early call to next(), we
+		// get the same output regardless of pre-fetching.
+		boolean hasData = s.next();
+
 		ResultSetMetaData rsmd = s.getMetaData();
 		SecurityCheck.inspect(rsmd, "java.sql.ResultSetMetaData");
 
@@ -821,7 +831,7 @@
 
 		StringBuffer row = new StringBuffer();
 		// Display data, fetching until end of the result set
-		while (s.next())
+		while (hasData)
 		{
 			row.append("\t{");
 			// Loop through each column, getting the
@@ -838,6 +848,7 @@
 				}
 			}
 			row.append("}\n");
+			hasData = s.next();
 		}
 		System.out.println(row.toString());
 		s.close();

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation.java?rev=387214&r1=387213&r2=387214&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation.java Mon Mar 20 06:20:56 2006
@@ -241,6 +241,9 @@
 					System.out.println(sql);					
 					ps.execute();
 					ResultSet rs = ps.getResultSet();
+					// fetch data so that we get the same errors with
+					// and without pre-fetching in execute()
+					rs.next();
 					showScanStatistics(rs,con);
 
 					// Now execute again and look at the locks

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation_sed.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation_sed.properties?rev=387214&r1=387213&r2=387214&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation_sed.properties (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/setTransactionIsolation_sed.properties Mon Mar 20 06:20:56 2006
@@ -6,4 +6,8 @@
 # Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
 #   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
 # No commas or semicolons can be allowed in the patterns/subsitutes.
-substitute=SQL_CUR.*;null
+#
+# Filter out some of the run-time statistics to prevent huge diffs
+# when changing pre-fetching behaviour.
+substitute=SQL_CUR.*;null,Number of opens ?=.*;<filtered number of opens>,Number of pages visited ?=.*;<filtered number of pages visited>,Number of rows qualified ?=.*;<filtered number of rows qualified>,Number of rows visited ?=.*;<filtered number of rows visited>,Rows returned ?=.*;<filtered rows returned>,Rows seen ?=.*;<filtered rows seen>
+delete=next time in milliseconds/row.*

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant?rev=387214&r1=387213&r2=387214&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/copyfiles.ant Mon Mar 20 06:20:56 2006
@@ -187,6 +187,7 @@
 repeat_derby.properties
 schemas.sql
 scrollCursors1.sql
+scrollCursors1_sed.properties
 scrollCursors3.sql
 scrollCursors3_app.properties
 select.sql

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1_sed.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1_sed.properties?rev=387214&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1_sed.properties (added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/scrollCursors1_sed.properties Mon Mar 20 06:20:56 2006
@@ -0,0 +1,11 @@
+# Filters and substitutes for SED
+# Multiple patterns for DELETE: comma separated
+#   delete=pattern1,pattern2,...,patternn
+# No commas can be allowed in the patterns.
+#
+# Multiple patterns for SUBSTITUTE: comma separated <pattern;substitute> pair
+#   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
+# No commas or semicolons can be allowed in the patterns/subsitutes.
+#
+# Filter out some of the run-time statistics that might change.
+substitute=Rows seen ?=.*;<filtered rows seen>,Number of reads from hash table ?=.*;<filtered number of reads from hash table>

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_sed.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_sed.properties?rev=387214&r1=387213&r2=387214&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_sed.properties (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/wisconsin_sed.properties Mon Mar 20 06:20:56 2006
@@ -7,7 +7,10 @@
 #   substitute=pattern1;substitute1,pattern2;substitute2,...,patternn;substituten
 # No commas or semicolons can be allowed in the patterns/subsitutes.
 ---------------------------------------------------------------------------------
-# need for JCC. true shows up as |1 | false as |0 |
-# also cursor names do not show up in rt statistics
-substitute=SQL_CURSN200C1;C,99349.65000000001 ;99349.65000000& 
-
+# Cursor names and the amount of pre-fetched data differ between the
+# frameworks. Since we are just testing which plan is chosen, we
+# filter out run-time statistics that are not relevant for the test.
+substitute=SQL_CURS[HN]200C1;C,99349.65000000001 ;99349.65000000& ,SQL_CURLH000C1;C,Number of opens ?=.*;<filtered number of opens>,Number of pages visited ?=.*;<filtered number of pages visited>,Number of rows qualified ?=.*;<filtered number of rows qualified>,Number of rows visited ?=.*;<filtered number of rows visited>,Rows returned ?=.*;<filtered rows returned>,Rows seen ?=.*;<filtered rows seen>,Rows seen from the left ?=.*;<filtered rows seen from the left>,Rows seen from the right ?=.*;<filtered rows seen from the right>,Statement executed\.;0 rows inserted/updated/deleted
+# next time does not always show up, so we remove it from the
+# output. Warning 01J01 only appears in embedded.
+delete=next time in milliseconds/row.*,WARNING 01J01:.*