db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r545323 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Thu, 07 Jun 2007 21:38:51 GMT
Author: mamta
Date: Thu Jun  7 14:38:50 2007
New Revision: 545323

URL: http://svn.apache.org/viewvc?view=rev&rev=545323
Log:
DERBY-2777
Fixed the combination of binary operator and parameters so that the parameters take their
collation from the context and not from the current
compilation schema. eg ? = TABLENAME

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java?view=diff&rev=545323&r1=545322&r2=545323
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BinaryOperatorNode.java
Thu Jun  7 14:38:50 2007
@@ -316,9 +316,6 @@
 
 			/* Set the left operand to the type of right parameter. */
 			leftOperand.setType(rightOperand.getTypeServices());
-			//collation of ? operand should be same as the compilation schema
-			leftOperand.setCollationUsingCompilationSchema(
-					StringDataValue.COLLATION_DERIVATION_IMPLICIT);
 		}
 
 		/* Is there a ? parameter on the right? */
@@ -326,9 +323,6 @@
 		{
 			/* Set the right operand to the type of the left parameter. */
 			rightOperand.setType(leftOperand.getTypeServices());
-			//collation of ? operand should be same as the compilation schema
-			rightOperand.setCollationUsingCompilationSchema(
-					StringDataValue.COLLATION_DERIVATION_IMPLICIT);
 		}
 
 		return genSQLJavaSQLTree();

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=545323&r1=545322&r2=545323
==============================================================================
--- 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 14:38:50 2007
@@ -666,19 +666,12 @@
 
     //Start of parameter testing
     //Start with simple ? param in a string comparison
-    //Won't work in territory based database because in ? = TABLENAME,
-    //? will get the collation of the current schema which is a user
-    //schema and hence the collation type of ? is territory based.
-    //But the collation of TABLENAME is UCS_BASIC
+    //Following will work fine because ? is supposed to take it's collation 
+    //from the context which in this case is from TABLENAME and TABLENAME
+    //has collation type of UCS_BASIC
     s.executeUpdate("set schema APP");
-    checkPreparedStatementError(conn, "SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
-    		" ? = TABLENAME", "42818");
-    //To fix the problem above, we need to CAST TABLENAME so that the result 
-    //of CAST will pick up the collation of the current schema and this will
-    //cause both the operands of ? = CAST(TABLENAME AS CHAR(10)) to have 
-    //same collation
     ps = conn.prepareStatement("SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
-		" ? = CAST(TABLENAME AS CHAR(10))");
+    		" ? = TABLENAME");
     ps.setString(1, "SYSCOLUMNS");
     rs = ps.executeQuery();
     JDBC.assertFullResultSet(rs,new String[][] {{"SYSCOLUMNS"}});      



Mime
View raw message