db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: [PATCH] JIRA 45 - support for cast(string) in like clause
Date Fri, 12 Nov 2004 02:21:25 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Submitted this patch.

Sending       
java\engine\org\apache\derby\impl\sql\compile\LikeEscapeOperatorNode.java
Transmitting file data .
Committed revision 57487.

myrnap wrote:

> replaced isConstantCharNode() with getTypeId().isStringTypeId(). The
standards imply that anything that resolves to a string should be
acceptable.
>
> Index:
java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
> ===================================================================
> ---
java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java   
(revision 57450)
> +++
java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java   
(working copy)
> @@ -157,7 +157,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");
>
> @@ -169,7 +170,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");
>
>
>-------------------------
>
>Index:
java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java
>===================================================================
>---
java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java   
(revision 57450)
>+++
java/engine/org/apache/derby/impl/sql/compile/LikeEscapeOperatorNode.java   
(working copy)
>@@ -157,7 +157,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");
>
>@@ -169,7 +170,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");
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFBlB4kENVNIY6DZ7ERAhmlAJ0TGbn6HN5o0AOuEHH3wT3dz08n5ACfaEpE
9AKsYfqVfAllGLvlwh7Z52A=
=JCj2
-----END PGP SIGNATURE-----


Mime
View raw message