db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1293467 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Fri, 24 Feb 2012 22:52:28 GMT
Author: mamta
Date: Fri Feb 24 22:52:28 2012
New Revision: 1293467

URL: http://svn.apache.org/viewvc?rev=1293467&view=rev
Log:
DERBY-4631 Wrong join column returned by right outer join with NATURAL or USING and territory-based
collation

Test join using global temporary tables


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

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java?rev=1293467&r1=1293466&r2=1293467&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Fri Feb 24 22:52:28 2012
@@ -718,6 +718,15 @@ public void testUsingClauseAndNaturalJoi
       //Test with views too
       s.executeUpdate("create view derby4631_v1 as select * from derby4631_t1");
       s.executeUpdate("create view derby4631_v2 as select * from derby4631_t2");
+      //Test with global temporary tables too
+      s.executeUpdate("DECLARE GLOBAL TEMPORARY TABLE gt1 " +
+    	      "(x varchar(5), y varchar(2)) " +
+    	      "on commit delete rows not logged");
+      s.executeUpdate("INSERT INTO session.gt1 VALUES ('A','z'),('B','y')");
+      s.executeUpdate("DECLARE GLOBAL TEMPORARY TABLE gt2" +
+    	      "(x varchar(5), y varchar(2)) " +
+    	      "on commit delete rows not logged");
+      s.executeUpdate("INSERT INTO session.gt2 VALUES ('b','Y'),('c','x')");
 
       //LEFT OUTER JOIN's join column value is not impacted by DERBY-4631 
       // and hence following is returning the correct results for both
@@ -731,6 +740,11 @@ public void testUsingClauseAndNaturalJoi
 			  "derby4631_v2", "derby4631_v1",
 			  " NATURAL LEFT OUTER JOIN ", "",
 			  new String[][] {{"b","Y","b","Y"},{"c","x","c","x"}});
+      //Test with global temporary tables
+	  joinTesting(s,"gt2", "gt1",
+			  "session.gt2 gt2", "session.gt1 gt1",
+			  " NATURAL LEFT OUTER JOIN ", "",
+			  new String[][] {{"b","Y","b","Y"},{"c","x","c","x"}});
       //Test with VALUES
 	  joinTesting(s,"v2", "v1",
 			  " (values ('b','Y'),('c','x')) v2(x,y) ",
@@ -758,6 +772,11 @@ public void testUsingClauseAndNaturalJoi
 			  "derby4631_v2", "derby4631_v1",
 			  "  LEFT OUTER JOIN ", " USING(x,y)",
 			  new String[][] {{"b","Y","b","Y"},{"c","x","c","x"}});
+      //Test with global temporary tables
+	  joinTesting(s,"gt2", "gt1",
+			  "session.gt2 gt2", "session.gt1 gt1",
+			  "  LEFT OUTER JOIN ", " USING(x,y)",
+			  new String[][] {{"b","Y","b","Y"},{"c","x","c","x"}});
       //Test with VALUES
 	  joinTesting(s,"v2", "v1",
 			  " (values ('b','Y'),('c','x')) v2(x,y) ",
@@ -784,6 +803,11 @@ public void testUsingClauseAndNaturalJoi
     			  "derby4631_v2", "derby4631_v1",
     			  " NATURAL RIGHT OUTER JOIN ", "",
     			  new String[][] {{"A","z","A","z"},{"B","y","b","Y"}});
+          //Test with global temporary tables
+    	  joinTesting(s,"gt2", "gt1",
+    			  "session.gt2 gt2", "session.gt1 gt1",
+    			  " NATURAL RIGHT OUTER JOIN ", "",
+    			  new String[][] {{"A","z","A","z"},{"B","y","b","Y"}});
           //Test with VALUES
     	  joinTesting(s,"v2", "v1",
     			  " (values ('b','Y'),('c','x')) v2(x,y) ",
@@ -811,6 +835,11 @@ public void testUsingClauseAndNaturalJoi
     			  "derby4631_v2", "derby4631_v1",
     			  " RIGHT OUTER JOIN ", " USING(x,y)",
     			  new String[][] {{"A","z","A","z"},{"B","y","b","Y"}});
+          //Test with global temporary tables
+    	  joinTesting(s,"gt2", "gt1",
+    			  "session.gt2 gt2", "session.gt1 gt1",
+    			  " RIGHT OUTER JOIN ", " USING(x,y)",
+    			  new String[][] {{"A","z","A","z"},{"B","y","b","Y"}});
           //Test with VALUES
     	  joinTesting(s,"v2", "v1",
     			  " (values ('b','Y'),('c','x')) v2(x,y) ",
@@ -863,6 +892,8 @@ public void testUsingClauseAndNaturalJoi
     			  new String[][] {{"A","z","A","z"},{"B","y","B","y"}});
       }
 
+      s.executeUpdate("DROP TABLE session.gt1");
+      s.executeUpdate("DROP TABLE session.gt2");
       s.executeUpdate("DROP VIEW derby4631_v1");
       s.executeUpdate("DROP VIEW derby4631_v2");
       s.executeUpdate("DROP TABLE derby4631_t1");



Mime
View raw message