db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: rev 57487 - incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile
Date Fri, 12 Nov 2004 02:14:55 GMT
Author: bandaram
Date: Thu Nov 11 18:14:55 2004
New Revision: 57487

Modified:
   incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
Log:
Derby-45: Allow expressions that result in string types as arguments to a LIKE expression

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
(original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
Thu Nov 11 18:14:55 2004
@@ -153,7 +153,8 @@
 			throw StandardException.newException(SQLState.LANG_DB2_LIKE_SYNTAX_ERROR);
 
 		// pattern must be a string or a parameter
-		if (!(leftOperand instanceof CharConstantNode) && !(leftOperand.isParameterNode()))
+
+		if (!(leftOperand.isParameterNode()) && !(leftOperand.getTypeId().isStringTypeId()))
 			throw StandardException.newException(SQLState.LANG_DB2_FUNCTION_INCOMPATIBLE,
 													 "LIKE", "FUNCTION");
 
@@ -165,7 +166,9 @@
 		}
 
 		// escape must be a string or a parameter
-		if (rightOperand != null && !(rightOperand instanceof CharConstantNode) &&
!(rightOperand.isParameterNode()))
+		if ((rightOperand != null) && 
+			!(rightOperand.isParameterNode()) && 
+			!(rightOperand.getTypeId().isStringTypeId()))
 		{
 			throw StandardException.newException(SQLState.LANG_DB2_FUNCTION_INCOMPATIBLE,
 										 "LIKE", "FUNCTION");

Mime
View raw message