List:General Discussion« Previous MessageNext Message »
From:Harald Fuchs Date:April 26 1999 4:28pm
Subject:MySQL bug with wildcard search?
View as plain text  
Hi,
I think I have found a bug in MySQL (3.21.33b, for pc-linux-gnu on
i686, if that should matter):

mysql> create table foo (bar varchar(20));
Query OK, 0 rows affected (0.00 sec)

mysql> insert into foo values ('aaa\\bbb');
Query OK, 1 row affected (0.00 sec)
           # Need to duplicate backslash since \b is a backspace, but we really
           # want `aaa backslash bbb'
mysql> select * from foo where bar like 'aaa%';
+---------+
| bar     |
+---------+
| aaa\bbb |
+---------+
1 row in set (0.00 sec)
           # Fine!
mysql> select * from foo where bar like 'aaa\b%';
Empty set (0.00 sec)
           # Mhm - maybe we need to escape the backslash again?
mysql> select * from foo where bar like 'aaa\\b%';
Empty set (0.00 sec)
           # This is a bug, I think ...
mysql> select * from foo where bar like 'aaa_b%';
+---------+
| bar     |
+---------+
| aaa\bbb |
+---------+
1 row in set (0.00 sec)
           # ... because this works
Thread
MySQL bug with wildcard search?Harald Fuchs26 Apr
  • Re: MySQL bug with wildcard search?Paul DuBois26 Apr