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 bp...@apache.org on 2009/10/30 16:08:11 UTC
svn commit: r831319 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
Author: bpendleton
Date: Fri Oct 30 15:08:10 2009
New Revision: 831319
URL: http://svn.apache.org/viewvc?rev=831319&view=rev
Log:
DERBY-4425: NPE with INSERT .. SELECT .. UNION and generated expressions
This patch adds a test which confirms that DERBY-4425 is fixed. The code
change which resolved DERBY-4425 was performed as part of fixing DERBY-4419,
since the same code change fixes both symptoms, so this is a test-only patch.
subversion revision 831304 contains the DERBY-4419 code change.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java?rev=831319&r1=831318&r2=831319&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsTest.java Fri Oct 30 15:08:10 2009
@@ -5307,6 +5307,21 @@
}
+ public void test_derby_4425()
+ throws Exception
+ {
+ Connection conn = getConnection();
+ goodStatement(conn, "create table t4425_1(x int)");
+ goodStatement(conn, "create table t4425_2(x int)");
+ goodStatement(conn, "insert into t4425_1 values 1,2");
+ goodStatement(conn, "insert into t4425_2 values 2,3");
+ goodStatement(conn, "create table t4425_3 (x int, " +
+ "y generated always as (2*x))");
+ goodStatement(conn, "insert into t4425_3(x) " +
+ "select * from t4425_1 union select * from t4425_2");
+ assertResults(conn, "select * from t4425_3",
+ new String[][] { {"1","2"},{"2","4"},{"3","6"}}, false);
+ }
///////////////////////////////////////////////////////////////////////////////////
//