Issue Details (XML | Word | Printable)

Key: DERBY-1231
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Bernt M. Johnsen
Reporter: Dyre Tjeldvoll
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

LIKE does not match empty strings when used with a prepared statement

Created: 20/Apr/06 06:02 PM   Updated: 13/Dec/07 09:04 AM
Return to search
Component/s: JDBC, SQL
Affects Version/s: 10.1.2.1, 10.1.3.1, 10.2.1.6, 10.3.1.4
Fix Version/s: 10.2.2.0, 10.3.1.4

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works DERBY-1231-v2.diff 2006-12-06 08:13 AM Bernt M. Johnsen 2 kB
File Licensed for inclusion in ASF works DERBY-1231-v3.diff 2006-12-06 09:25 AM Bernt M. Johnsen 2 kB
File Licensed for inclusion in ASF works DERBY-1231.diff 2006-12-05 07:50 AM Bernt M. Johnsen 1 kB
Java Source File Licensed for inclusion in ASF works vti.java 2006-04-20 06:06 PM Dyre Tjeldvoll 2 kB
Issue Links:
Blocker
 
Incorporates
 
Reference
 

Urgency: Normal
Resolution Date: 06/Dec/06 11:46 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.