db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r545708 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/ValueNodeList.java testing/org/apache/derbyTesting/functionTests/tests/lang/CollationTest.java
Date Sat, 09 Jun 2007 08:01:30 GMT
Author: mamta
Date: Sat Jun  9 01:01:29 2007
New Revision: 545708

URL: http://svn.apache.org/viewvc?view=rev&rev=545708
Log:
DERBY-2777
Make sure that for operators like BOOLEAN, the collation information is picked from the context
and not from the current compilation schema.


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.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/ValueNodeList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java?view=diff&rev=545708&r1=545707&r2=545708
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ValueNodeList.java Sat
Jun  9 01:01:29 2007
@@ -582,10 +582,6 @@
 			if (valueNode.requiresTypeFromContext())
 			{
 				valueNode.setType(descriptor);
-				//? parameter should pick up the collation type of the schema in
-				//which this statement is getting compiled.
-				valueNode.setCollationUsingCompilationSchema(
-						StringDataValue.COLLATION_DERIVATION_IMPLICIT);
 			}
 		}
 	}

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=545708&r1=545707&r2=545708
==============================================================================
--- 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
Sat Jun  9 01:01:29 2007
@@ -768,6 +768,19 @@
     checkPreparedStatementError(conn, "SELECT COUNT(*) FROM CUSTOMER WHERE " +
     		" LENGTH(?) != 0", "42X36");   
 
+    //Do parameter testing for BETWEEN
+    //Following should pass for ? will take the collation from the context and
+    //hence, it will be UCS_BASIC
+    ps = conn.prepareStatement("SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
+	" TABLENAME NOT BETWEEN ? AND TABLENAME");   
+    ps.setString(1, " ");
+    rs = ps.executeQuery();
+	JDBC.assertEmpty(rs);
+	//Following will fail because ? will take collation of territory based but
+	//the left hand side has collation of UCS_BASIC
+    checkPreparedStatementError(conn, "SELECT TABLENAME FROM SYS.SYSTABLES WHERE " +
+    		" TABLENAME NOT BETWEEN ? AND 'SYSCOLUMNS'", "42818");   
+    
     //Do parameter testing with COALESCE
     //following will pass because the ? inside the COALESCE will take the 
     //collation type of the other operand which is TABLENAME. The result of



Mime
View raw message