db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r545381 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Fri, 08 Jun 2007 02:59:57 GMT
Author: mamta
Date: Thu Jun  7 19:59:56 2007
New Revision: 545381

URL: http://svn.apache.org/viewvc?view=rev&rev=545381
Log:
DERBY-2678
There are some test cases in CollationTest.java which should pass after rule 1b) in DERBY-2678
is fixed. They should all pass but they do 
not because we just check if the 2 sides of the collation operation have same derivation or
not and if not, then we throw an exception. But 
for the case where one side has collation derivation of NONE and the other side has IMPLICIT,
we should do the collation using the collation 
type of the side that has collation derivation of NONE. Once we fix this, the CollationTest
will fail and will need to be fixed. I am adding
comments in CollationTest.java wherever the rule 1b) should apply. Please fix these comments
in the test when you are implementing rule 1b)


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?view=diff&rev=545381&r1=545380&r2=545381
==============================================================================
--- 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
Thu Jun  7 19:59:56 2007
@@ -529,7 +529,12 @@
     //aggregate method has operands with different collations, then the 
     //result will have collation derivation of NONE. The right side of =
     //operation has collation type of territory based and hence the following
-    //sql fails.
+    //sql fails. DERBY-2678 This query should not fail because even though 
+    //left hand side of = has collation derivation of NONE, the right hand
+    //side has collation derivation of IMPLICIT, and so we should just pick the
+    //collation of the rhs as per SQL standard. Once DERBY-2678 is fixed, we
+    //don't need to use the CAST on this query to make it work (we are doing
+    //that in the next test).
     assertStatementError("42818", s, "SELECT TABLENAME FROM SYS.SYSTABLES WHERE CASE " +
     		" WHEN 1=1 THEN TABLENAME ELSE 'c' END = 'SYSCOLUMNS'");
     //CASTing the result of the CASE expression will solve the problem in the
@@ -547,7 +552,12 @@
     //but constant character string ' ' has collation type of territory based
     //So the left hand side of = operator has collation derivation of NONE
     //and right hand side has collation derivation of territory based and
-    //that causes the = comparison to fail
+    //that causes the = comparison to fail. DERBY-2678 This query should not 
+    //fail because even though left hand side of = has collation derivation of 
+    //NONE, the right hand side has collation derivation of IMPLICIT, and so we 
+    //should just pick the collation of the rhs as per SQL standard. Once 
+    //DERBY-2678 is fixed, we don't need to use the CAST on this query to make 
+    //it work (we are doing that in the next test).
     assertStatementError("42818", s, "SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
     		" TABLENAME || ' ' = 'SYSCOLUMNS '");   
     //CASTing the result of the concat expression will solve the problem in 
@@ -565,7 +575,12 @@
     //but constant character string 'c' has collation type of territory based
     //So the left hand side of = operator has collation derivation of NONE
     //and right hand side has collation derivation of territory based and
-    //that causes the = comparison to fail
+    //that causes the = comparison to fail. DERBY-2678 This query should not 
+    //fail because even though left hand side of = has collation derivation of 
+    //NONE, the right hand side has collation derivation of IMPLICIT, and so we 
+    //should just pick the collation of the rhs as per SQL standard. Once 
+    //DERBY-2678 is fixed, we don't need to use the CAST on this query to make 
+    //it work (we are doing that in the next test).
     assertStatementError("42818", s, "SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
     		" COALESCE(TABLENAME, 'c') = 'SYSCOLUMNS'");   
     //CASTing the result of the COALESCE expression will solve the problem in 
@@ -583,7 +598,12 @@
     //but constant character string 'c' has collation type of territory based
     //So the left hand side of = operator has collation derivation of NONE
     //and right hand side has collation derivation of territory based and
-    //that causes the = comparison to fail
+    //that causes the = comparison to fail. DERBY-2678 This query should not 
+    //fail because even though left hand side of = has collation derivation of 
+    //NONE, the right hand side has collation derivation of IMPLICIT, and so 
+    //we should just pick the collation of the rhs as per SQL standard. Once 
+    //DERBY-2678 is fixed, we don't need to use the CAST on this query to make 
+    //it work (we are doing that in the next test).
     assertStatementError("42818", s, "SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
 		" NULLIF(TABLENAME, 'c') = 'SYSCOLUMNS'");   
     //CASTing the result of the NULLIF expression will solve the problem in 



Mime
View raw message