db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bernt M. Johnsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-1231) LIKE does not match empty strings when used with a prepared statement
Date Tue, 05 Dec 2006 10:10:26 GMT
    [ http://issues.apache.org/jira/browse/DERBY-1231?page=comments#action_12455567 ] 
Bernt M. Johnsen commented on DERBY-1231:

Thanks Knut! lessThanString will never be called with pattern==null since null is not allowed
as a literal for pattern. When using a parameter, null is allowed, but the check is done in
lessThanStringFromParameter and lessThanStringFromParameterWithEsc before lessThanString is
called. I'l incorporate the comments in the patch.

Dyre: You're right. I'll create an separate issue for a change to metadata.properties that
should NOT be ported to the 10.2 branch.

> LIKE does not match empty strings when used with a prepared statement
> ---------------------------------------------------------------------
>                 Key: DERBY-1231
>                 URL: http://issues.apache.org/jira/browse/DERBY-1231
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, SQL
>    Affects Versions:,,,
>            Reporter: Dyre Tjeldvoll
>         Assigned To: Bernt M. Johnsen
>             Fix For:
>         Attachments: DERBY-1231.diff, vti.java
> LIKE should give true for two 0-length strings. See SQL 2003 Ch. 8.5
> General Rules 3)c)i)
> The query SELECT * FROM t WHERE v like ''
> appears to give me all rows where v is an empty
> string, as expected.
> But a prepared statement
> SELECT * FROM t WHERE v like ?, with setString(1, "")
> always returns an empty result set. See attached repro for the full example.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message