1
by brian
clean slate |
1 |
drop table if exists t1; |
2 |
create table t1 (a varchar(10), key(a)); |
|
3 |
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test"); |
|
4 |
explain extended select * from t1 where a like 'abc%'; |
|
5 |
id select_type table type possible_keys key key_len ref rows filtered Extra |
|
383.1.16
by Brian Aker
Force client communication into UTF8 |
6 |
1 SIMPLE t1 index a a 43 NULL 5 40.00 Using where; Using index |
1
by brian
clean slate |
7 |
Warnings: |
370.1.1
by arjen at com
Initial mods for making all tests work again. Some tests adapted+added. |
8 |
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 'abc%') |
1
by brian
clean slate |
9 |
explain extended select * from t1 where a like concat('abc','%'); |
10 |
id select_type table type possible_keys key key_len ref rows filtered Extra |
|
383.1.16
by Brian Aker
Force client communication into UTF8 |
11 |
1 SIMPLE t1 index a a 43 NULL 5 40.00 Using where; Using index |
1
by brian
clean slate |
12 |
Warnings: |
1240.8.5
by Dennis Schoen
record changes to main.func_like |
13 |
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like <cache>(concat('abc','%'))) |
1
by brian
clean slate |
14 |
select * from t1 where a like "abc%"; |
15 |
a
|
|
16 |
abc
|
|
17 |
abcd
|
|
18 |
select * from t1 where a like concat("abc","%"); |
|
19 |
a
|
|
20 |
abc
|
|
21 |
abcd
|
|
22 |
select * from t1 where a like "ABC%"; |
|
23 |
a
|
|
24 |
abc
|
|
25 |
abcd
|
|
26 |
select * from t1 where a like "test%"; |
|
27 |
a
|
|
28 |
test
|
|
29 |
select * from t1 where a like "te_t"; |
|
30 |
a
|
|
31 |
test
|
|
32 |
select * from t1 where a like "%a%"; |
|
33 |
a
|
|
34 |
a
|
|
35 |
abc
|
|
36 |
abcd
|
|
37 |
select * from t1 where a like "%abcd%"; |
|
38 |
a
|
|
39 |
abcd
|
|
40 |
select * from t1 where a like "%abc\d%"; |
|
41 |
a
|
|
42 |
abcd
|
|
43 |
drop table t1; |
|
44 |
create table t1 (a varchar(10), key(a)); |
|
45 |
insert into t1 values ('a'), ('a\\b'); |
|
46 |
select * from t1 where a like 'a\\%' escape '#'; |
|
47 |
a
|
|
48 |
a\b |
|
49 |
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b'; |
|
50 |
a
|
|
51 |
a\b |
|
52 |
drop table t1; |
|
53 |
create table t1 (a datetime); |
|
54 |
insert into t1 values ('2004-03-11 12:00:21'); |
|
55 |
select * from t1 where a like '2004-03-11 12:00:21'; |
|
56 |
a
|
|
57 |
2004-03-11 12:00:21 |
|
58 |
drop table t1; |