Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E939D10118 for ; Thu, 29 Aug 2013 09:27:57 +0000 (UTC) Received: (qmail 76282 invoked by uid 500); 29 Aug 2013 09:27:57 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 76227 invoked by uid 500); 29 Aug 2013 09:27:56 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 76220 invoked by uid 99); 29 Aug 2013 09:27:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Aug 2013 09:27:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Aug 2013 09:27:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8FFCB238889B; Thu, 29 Aug 2013 09:27:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: derby-commits@db.apache.org From: kahatlen@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130829092731.8FFCB238889B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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