db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1518551 - in /db/derby/code/branches/10.10: ./ java/testing/org/apache/derbyTesting/functionTests/tests/lang/ java/testing/org/apache/derbyTesting/junit/
Date Thu, 29 Aug 2013 09:27:31 GMT
Author: kahatlen
Date: Thu Aug 29 09:27:31 2013
New Revision: 1518551

URL: http://svn.apache.org/r1518551
Log:
DERBY-6306: XplainStatisticsTest.testSimpleQuery: BEGIN_COMP_TIME unexpectedly NULL

Merged revision 1518533 from trunk.

Modified:
    db/derby/code/branches/10.10/   (props changed)
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StatementPlanCacheTest.java
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XplainStatisticsTest.java
    db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java

Propchange: db/derby/code/branches/10.10/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1518533

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StatementPlanCacheTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StatementPlanCacheTest.java?rev=1518551&r1=1518550&r2=1518551&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StatementPlanCacheTest.java
(original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StatementPlanCacheTest.java
Thu Aug 29 09:27:31 2013
@@ -110,10 +110,7 @@ public class StatementPlanCacheTest exte
         cacheInPlanPS_TEXT = prepareStatement(
                 "SELECT COUNT(ID) FROM SYSCS_DIAG.STATEMENT_CACHE WHERE " +
                 "SCHEMANAME = ? AND SQL_TEXT = ?");
-        Statement s = createStatement();
-        s.execute("CALL SYSCS_UTIL.SYSCS_EMPTY_STATEMENT_CACHE()");
-        s.close();
-       
+        emptyStatementCache();
     }
     
     protected void tearDown() throws Exception {

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XplainStatisticsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XplainStatisticsTest.java?rev=1518551&r1=1518550&r2=1518551&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XplainStatisticsTest.java
(original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/functionTests/tests/lang/XplainStatisticsTest.java
Thu Aug 29 09:27:31 2013
@@ -100,6 +100,17 @@ public class XplainStatisticsTest extend
 	}
         private static long timeSuiteStarted;
 
+    protected void setUp() throws SQLException {
+        // DERBY-6306: Some of the statistics, especially those that give
+        // information about compilation timing, are sensitive to whether
+        // preparing a statement in fact compiles the statement or if it
+        // just fetches it from the statement cache. Empty the statement
+        // cache between each test case, so that they don't need to worry
+        // about statements lying around from earlier test cases affecting
+        // the results.
+        emptyStatementCache();
+    }
+
 	/**
 	 * Creates a variety of tables used by the various tests.
          * The tests use the same basic schema as the 'toursdb' sample

Modified: db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java?rev=1518551&r1=1518550&r2=1518551&view=diff
==============================================================================
--- db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
(original)
+++ db/derby/code/branches/10.10/java/testing/org/apache/derbyTesting/junit/BaseJDBCTestCase.java
Thu Aug 29 09:27:31 2013
@@ -1046,6 +1046,19 @@ public abstract class BaseJDBCTestCase
     }
 
     /**
+     * Clear the contents of the statement cache. Useful if a test case
+     * needs to make sure that a statement is actually compiled and not
+     * just fetched from the statement cache.
+     *
+     * @throws SQLException if a database error happens
+     */
+    protected final void emptyStatementCache() throws SQLException {
+        Statement s = createStatement();
+        s.execute("CALL SYSCS_UTIL.SYSCS_EMPTY_STATEMENT_CACHE()");
+        closeStatement(s);
+    }
+
+    /**
      * Execute a DROP TABLE command using the passed in tableName as-is
      * and the default connection.
      * If the DROP TABLE fails because the table does not exist then



Mime
View raw message