db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1525819 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerWhenClauseTest.java
Date Tue, 24 Sep 2013 09:00:54 GMT
Author: kahatlen
Date: Tue Sep 24 09:00:53 2013
New Revision: 1525819

URL: http://svn.apache.org/r1525819
Log:
DERBY-534: Add a disabled test case for NPE with subquery in WHEN clause

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerWhenClauseTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerWhenClauseTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerWhenClauseTest.java?rev=1525819&r1=1525818&r2=1525819&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerWhenClauseTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/TriggerWhenClauseTest.java
Tue Sep 24 09:00:53 2013
@@ -21,6 +21,7 @@
 
 package org.apache.derbyTesting.functionTests.tests.lang;
 
+import java.sql.Connection;
 import java.sql.SQLException;
 import java.sql.Statement;
 import junit.framework.Test;
@@ -41,6 +42,13 @@ public class TriggerWhenClauseTest exten
         return TestConfiguration.defaultSuite(TriggerWhenClauseTest.class);
     }
 
+    @Override
+    protected void initializeConnection(Connection conn) throws SQLException {
+        // Run the test cases with auto-commit off so that all changes to
+        // the database can be rolled back in tearDown().
+        conn.setAutoCommit(false);
+    }
+
     public void testBasicSyntax() throws SQLException {
         Statement s = createStatement();
         s.execute("create table t1(x int)");
@@ -91,4 +99,19 @@ public class TriggerWhenClauseTest exten
             });
     }
 
+    /**
+     * A row trigger whose WHEN clause contains a subquery, could cause a
+     * NullPointerException. This test case is disabled until the bug is fixed.
+     */
+    public void xtestSubqueryInWhenClauseNPE() throws SQLException {
+        Statement s = createStatement();
+        s.execute("create table t1(x int)");
+        s.execute("create table t2(x int)");
+        s.execute("create trigger tr1 after insert on t1 for each row "
+                + "when ((values true)) insert into t2 values 1");
+
+        // This statement results in a NullPointerException.
+        s.execute("insert into t1 values 1,2,3");
+    }
+
 }



Mime
View raw message