db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Van Couvering (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-20) LIKE handles strings with control characters incorrectly.
Date Thu, 21 Jul 2005 20:17:54 GMT
    [ http://issues.apache.org/jira/browse/DERBY-20?page=comments#action_12316409 ] 

David Van Couvering commented on DERBY-20:

Paul Riethmuller writes:

That is not a Derby bug - it's being strict about the SQL standard.

Your LIKE string contains no wildcard characters, so you should write either:

   le.name = 'Ber%'
   le.name LIKE 'Ber\%%' ESCAPE '\'

depending on your intention.



but then Mitesh Meshwani responds:

FWIW,  We get the same result using db2jcc.jar as driver against derby
That is when using the original query (with Ber\%% for the Like clause ), we do not get the
expected rows.
When using the modified query (Ber\% for the Like clause ), we get an exception with SQLSTATE=22025
("The LIKE predicate string pattern contains an invalid occurrence of an escape character.")


> LIKE handles strings with control characters incorrectly.
> ---------------------------------------------------------
>          Key: DERBY-20
>          URL: http://issues.apache.org/jira/browse/DERBY-20
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions:
>     Reporter: Tulika Agrawal
>     Priority: Minor
>  Attachments: server.log
> Reporting for Daniel John Debrunner.
> If a string contains control characters in the regions matched 
> by wild card characters then in some situations a LIKE will 
> return false instead of true and the row will not be returned.
> Caused by the dynamic like optimization using >= with a prefix 
> which is is equivalent to >= on the prefeix appended with 
> blanks and not null (\u0000) characters.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message