Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 29362 invoked from network); 15 Aug 2007 15:58:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Aug 2007 15:58:18 -0000 Received: (qmail 36596 invoked by uid 500); 15 Aug 2007 15:58:15 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 36574 invoked by uid 500); 15 Aug 2007 15:58:15 -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 36554 invoked by uid 99); 15 Aug 2007 15:58:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2007 08:58:14 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Aug 2007 15:58:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 412DF1A981A; Wed, 15 Aug 2007 08:57:56 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r566235 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java Date: Wed, 15 Aug 2007 15:57:56 -0000 To: derby-commits@db.apache.org From: abrown@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070815155756.412DF1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: abrown Date: Wed Aug 15 08:57:55 2007 New Revision: 566235 URL: http://svn.apache.org/viewvc?view=rev&rev=566235 Log: DERBY-2986: Add regression test case to lang/CaseExpressionTest.java. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java?view=diff&rev=566235&r1=566234&r2=566235 ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CaseExpressionTest.java Wed Aug 15 08:57:55 2007 @@ -31,6 +31,7 @@ import org.apache.derbyTesting.junit.BaseJDBCTestCase; import org.apache.derbyTesting.junit.CleanDatabaseTestSetup; +import org.apache.derbyTesting.junit.JDBC; import org.apache.derbyTesting.junit.SQLUtilities; import org.apache.derbyTesting.junit.TestConfiguration; @@ -183,6 +184,43 @@ "SELECT CASE WHEN 1 = 1 THEN NULL " + "ELSE (CASE WHEN 1 = 1 THEN NULL ELSE ", " END) END from AllDataTypesTable"); + + s.close(); + } + + /** + * Test a query that has many WHEN conditions in it. This is mostly + * checking for the performance regression filed as DERBY-2986. That + * regression may not be noticeable in the scope of the full regression + * suite, but if this test is run standalone then this fixture could + * still be useful. + */ + public void testMultipleWhens() throws SQLException + { + Statement s = createStatement(); + JDBC.assertFullResultSet( + s.executeQuery( + "values CASE WHEN 10 = 1 THEN 'a' " + + "WHEN 10 = 2 THEN 'b' " + + "WHEN 10 = 3 THEN 'c' " + + "WHEN 10 = 4 THEN 'd' " + + "WHEN 10 = 5 THEN 'e' " + + "WHEN 10 = 6 THEN 'f' " + + "WHEN 10 = 7 THEN 'g' " + + "WHEN 10 = 8 THEN 'h' " + + "WHEN 10 = 11 THEN 'i' " + + "WHEN 10 = 12 THEN 'j' " + + "WHEN 10 = 15 THEN 'k' " + + "WHEN 10 = 16 THEN 'l' " + + "WHEN 10 = 23 THEN 'm' " + + "WHEN 10 = 24 THEN 'n' " + + "WHEN 10 = 27 THEN 'o' " + + "WHEN 10 = 31 THEN 'p' " + + "WHEN 10 = 41 THEN 'q' " + + "WHEN 10 = 42 THEN 'r' " + + "WHEN 10 = 50 THEN 's' " + + "ELSE '*' END"), + new String[][] {{"*"}}); s.close(); }