You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by ma...@apache.org on 2007/07/06 07:13:13 UTC

svn commit: r553735 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java

Author: mamta
Date: Thu Jul  5 22:13:13 2007
New Revision: 553735

URL: http://svn.apache.org/viewvc?view=rev&rev=553735
Log:
DERBY-2777

TernaryOperatorNode was incorrectly setting up collation for non-character string type. Collation only applies to character
string types. Also, fixed a comment to be more meaningful.



Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java?view=diff&rev=553735&r1=553734&r2=553735
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TernaryOperatorNode.java Thu Jul  5 22:13:13 2007
@@ -599,9 +599,9 @@
 		** The result type of trim is varchar.
 		*/
 		setResultType(resultType);
-		//Result of TRIM should pick up the collation of the 1st argument
-		//to TRIM. The 1st argument to TRIM is represented by the variable
-		//receiver in this class.
+		//Result of TRIM should pick up the collation of the character string
+		//that is getting trimmed (which is variable receiver) because it has
+		//correct collation set on it.
 		getTypeServices().setCollationDerivation(
 				receiver.getTypeServices().getCollationDerivation());
 		getTypeServices().setCollationType(
@@ -687,9 +687,6 @@
 		{
 			rightOperand.setType(
 				new DataTypeDescriptor(TypeId.INTEGER_ID, true)); 
-			//collation of ? operand should be same as the compilation schema
-			rightOperand.setCollationUsingCompilationSchema(
-					StringDataValue.COLLATION_DERIVATION_IMPLICIT);
 		}
 
 		bindToBuiltIn();