db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Fox (Resolved) (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (TORQUE-96) Can not use * or ? in LIKE clauses
Date Mon, 30 Jan 2012 19:10:11 GMT

     [ https://issues.apache.org/jira/browse/TORQUE-96?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Thomas Fox resolved TORQUE-96.

       Resolution: Fixed
    Fix Version/s: 4.0

* and ? are treaded as additional wildcards since I can remember.
You can (now?) escape * and ? with backslashes. See org.apache.torque.DataTest.testLikeClauseEscaping()
> Can not use * or ? in LIKE clauses
> ----------------------------------
>                 Key: TORQUE-96
>                 URL: https://issues.apache.org/jira/browse/TORQUE-96
>             Project: Torque
>          Issue Type: Bug
>          Components: Runtime
>    Affects Versions: 3.3-RC3, 3.3
>            Reporter: CG Monroe
>            Priority: Minor
>             Fix For: 4.0
> If you have a ? or * in a like criteria, they get replaced with "_" and "%" in the SqlExpression
class.  However, this causes problems if you want to search for these characters.
> If you try to escape them with a \, the SQL generated is invalid for some DB's (Like
MS SQL).  This causes an SQLException to be thrown with text like:
> Invalid escape sequence. Valid characters after ESC are: an ESC pair, underscore, percent
> My memory is that % and _ are the SQL standard wild card/match characters.  So, is the
bug here that since ? and * are non-standard
> they should not be processed?
> If for some reason they need to be processed, do we go down the road of having a Torque
escape character so that these characters can be searched?  
> But this leads to possibly requiring stuff like "\\\\" in criterias to get an escaped
\\ to the SQL parser so that single \ can be passed.  This can be very confusing and would
need to be documented correctly somewhere.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org

View raw message