db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1292108 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Wed, 22 Feb 2012 02:07:07 GMT
Author: mamta
Date: Wed Feb 22 02:07:07 2012
New Revision: 1292108

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

Test delete from a table with data from JOINs


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=1292108&r1=1292107&r2=1292108&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
Wed Feb 22 02:07:07 2012
@@ -542,7 +542,12 @@ public void testUsingClauseAndNaturalJoi
           		"FROM derby4631_t2 NATURAL LEFT OUTER JOIN derby4631_t1");
       checkLangBasedQuery(s, "SELECT * FROM derby4631_t3 ",
       		new String[][] {{"b","b"},{"c","c"}});
-      s.executeUpdate("DELETE FROM derby4631_t3");
+      s.executeUpdate("DELETE FROM derby4631_t3 where x1 in "+
+        		"(SELECT " +
+        		"coalesce(derby4631_t2.x, derby4631_t1.x) cx " +
+        		"FROM derby4631_t2 NATURAL LEFT OUTER JOIN derby4631_t1)");
+        checkLangBasedQuery(s, "SELECT * FROM derby4631_t3",
+          		null);
       //Do the same test as above, but this time using the USING clause
       // rather the NATURAL join
       s.executeUpdate("INSERT INTO derby4631_t3 " +
@@ -551,7 +556,12 @@ public void testUsingClauseAndNaturalJoi
       		"FROM derby4631_t2 LEFT OUTER JOIN derby4631_t1 USING(x)");
     checkLangBasedQuery(s, "SELECT * FROM derby4631_t3 ",
     		new String[][] {{"b","b"},{"c","c"}});
-    s.executeUpdate("DELETE FROM derby4631_t3");
+    s.executeUpdate("DELETE FROM derby4631_t3 where x1 in "+
+      		"(SELECT " +
+      		"coalesce(derby4631_t2.x, derby4631_t1.x) cx " +
+      		"FROM derby4631_t2 LEFT OUTER JOIN derby4631_t1 USING(x))");
+      checkLangBasedQuery(s, "SELECT * FROM derby4631_t3",
+        		null);
       //Test nested NATURAL LEFT OUTER JOIN. They will return correct data
       // with both territory and non-territory based dbs.
       checkLangBasedQuery(s, "SELECT x " +
@@ -608,7 +618,12 @@ public void testUsingClauseAndNaturalJoi
               		"FROM derby4631_t2 NATURAL RIGHT OUTER JOIN derby4631_t1");
           checkLangBasedQuery(s, "SELECT * FROM derby4631_t3 ",
           		new String[][] {{"A","A"},{"B","b"}});
-          s.executeUpdate("DELETE FROM derby4631_t3");
+          s.executeUpdate("DELETE FROM derby4631_t3 where x1 in "+
+            		"(SELECT " +
+            		"coalesce(derby4631_t2.x, derby4631_t1.x) cx " +
+            		"FROM derby4631_t2 NATURAL RIGHT OUTER JOIN derby4631_t1)");
+            checkLangBasedQuery(s, "SELECT * FROM derby4631_t3",
+              		null);
           //Do the same test as above, but this time using the USING clause
           // rather the NATURAL join
           s.executeUpdate("INSERT INTO derby4631_t3 " +
@@ -617,7 +632,12 @@ public void testUsingClauseAndNaturalJoi
           		"FROM derby4631_t2 RIGHT OUTER JOIN derby4631_t1 USING(x)");
           checkLangBasedQuery(s, "SELECT * FROM derby4631_t3 ",
           		new String[][] {{"A","A"},{"B","b"}});
-          s.executeUpdate("DELETE FROM derby4631_t3");
+          s.executeUpdate("DELETE FROM derby4631_t3 where x1 in "+
+          		"(SELECT " +
+          		"coalesce(derby4631_t2.x, derby4631_t1.x) cx " +
+          		"FROM derby4631_t2 RIGHT OUTER JOIN derby4631_t1 USING(x))");
+          checkLangBasedQuery(s, "SELECT * FROM derby4631_t3",
+            		null);
           
           //Test nested NATURAL RIGHT OUTER JOIN
           checkLangBasedQuery(s, "SELECT x " +



Mime
View raw message