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
Repository Revision Date User Message
ASF #482983 Wed Dec 06 09:26:27 UTC 2006 bernt DERBY-1231 LIKE does not match empty strings when used with a prepared statement.
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/Like.java

Repository Revision Date User Message
ASF #483042 Wed Dec 06 11:45:17 UTC 2006 bernt DERBY-1231 Did svn merge -r 482982:482983 https://svn.apache.org/repos/asf/db/derby/code/trunk
Files Changed
MODIFY /db/derby/code/branches/10.2/java/engine/org/apache/derby/iapi/types/Like.java

Repository Revision Date User Message
ASF #483521 Thu Dec 07 16:22:54 UTC 2006 rhillegas DERBY-2129: Add a couple more bug fixes to the release notes. These were ported to the 10.2 branch in the last week: DERBY-1231, DERBY-2131, DERBY-1204.
Files Changed
MODIFY /db/derby/code/branches/10.2/RELEASE-NOTES.html