LIKE operator fails on case-sensitive matches at the column border

LIKE operator fails on case-sensitive matches at the column border

am 10.04.2003 13:15:57 von Josef Svoboda

Problem: LIKE operator fails on case-sensitive matches at the
column border
Version: MySQL 3.23.54 compiled from source running on FreeBSD
Problem is demonstrated by the following commands.
Josef Svoboda

use test;
drop table if exists test;
create table test (col1 char(2), index(col1));
insert into test values('a');
insert into test values('aa');
select col1 as ex1 from test where col1 like 'a%'; -- OK
(selects 2 lines)
select col1 as ex2 from test where col1 like 'aa%'; -- OK
(selects 1 lines)
select col1 as ex3 from test where col1 like 'A%'; -- error
(selects 1 lines)
select col1 as ex4 from test where col1 like 'AA%'; -- error
(selects 0 lines)


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: LIKE operator fails on case-sensitive matches at the column border

am 11.04.2003 14:51:44 von Sinisa Milivojevic

Josef Svoboda writes:
> Problem: LIKE operator fails on case-sensitive matches at the
> column border
> Version: MySQL 3.23.54 compiled from source running on FreeBSD
> Problem is demonstrated by the following commands.
> Josef Svoboda
>
> use test;
> drop table if exists test;
> create table test (col1 char(2), index(col1));
> insert into test values('a');
> insert into test values('aa');
> select col1 as ex1 from test where col1 like 'a%'; -- OK
> (selects 2 lines)
> select col1 as ex2 from test where col1 like 'aa%'; -- OK
> (selects 1 lines)
> select col1 as ex3 from test where col1 like 'A%'; -- error
> (selects 1 lines)
> select col1 as ex4 from test where col1 like 'AA%'; -- error
> (selects 0 lines)

Hi!

I just tested and it worked just fine for me with 4.0.12:

[/mnt/work/mysql-4.0]$ mysql telcent -e "select * from nazivi"
+------+------------+
| BROJ | naziv |
+------+------------+
| 1 | jedan |
| 2 | dva |
| 3 | tri |
| 4 | xxxxxxxxxx |
| 5 | a |
| 10 | |
| 6 | Sinisa |
| 7 | Satkica |
| 8 | yyyyy |
| 9 | yyyyy |
| 11 | aa |
+------+------------+
[/mnt/work/mysql-4.0]$ mysql telcent -e "select * from nazivi where naziv like 'A%'"
+------+-------+
| BROJ | naziv |
+------+-------+
| 5 | a |
| 11 | aa |
+------+-------+
[/mnt/work/mysql-4.0]$ mysql telcent -e "select * from nazivi where naziv like 'YY%'"
+------+-------+
| BROJ | naziv |
+------+-------+
| 8 | yyyyy |
| 9 | yyyyy |
+------+-------+
[/mnt/work/mysql-4.0]$ mysql telcent -e "describe nazivi"
+-------+-----------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------+------+-----+---------+-------+
| BROJ | int(4) unsigned | | PRI | 0 | |
| naziv | char(25) | YES | MUL | NULL | |
+-------+-----------------+------+-----+---------+-------+


--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com



--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org