Bug #5919 Bug in WHERE column LIKE '?%'
Submitted: 6 Oct 2004 10:43 Modified: 6 Oct 2004 11:21
Reporter: Andreas Ruppert Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:MySQL 4.0.21 OS:
Assigned to: CPU Architecture:Any

[6 Oct 2004 10:43] Andreas Ruppert
Description:
Dear beings,

i found an litle bug!?

if i use SELECT name FROM table WHERE name LIKE 'O%', then MySQL didn't find the name 
O`Reilly
  =

if i use SELECT name FROM table WHERE name LIKE 'O`%', then MySQL found the name O`Reilly

if i use SELECT name FROM table WHERE name LIKE 'OGU%', then MySQL didn't find the name 
OGU`Reilly
      =

if i use SELECT name FROM table WHERE name LIKE 'OGU`%', then MySQL found the name 
OGU`Reilly
      =

special :-)
if i use SELECT name FROM table WHERE name LIKE 'O%U%', then MySQL found the name 
OGU`Reilly
      =

` == CHAR(96) == HEX 60

nice regards
Andreas Ruppert (Cologne)

How to repeat:
first create an database row with the string 'O`Reilly', then try to select this row.
[6 Oct 2004 11:21] Alexander Keremidarski
mysql> SELECT * FROM t WHERE t LIKE "O%";
+----------+
| t        |
+----------+
| O`Reilly |
+----------+
[6 Oct 2004 11:40] Andreas Ruppert
please use MySQL 4.0.21, in older versions we didn't have this bug