6
drop table if exists t1;
9
create table t1 (a varchar(10), key(a));
10
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
11
explain extended select * from t1 where a like 'abc%';
12
explain extended select * from t1 where a like concat('abc','%');
13
select * from t1 where a like "abc%";
14
select * from t1 where a like concat("abc","%");
15
select * from t1 where a like "ABC%";
16
select * from t1 where a like "test%";
17
select * from t1 where a like "te_t";
20
# The following will test the Turbo Boyer-Moore code
22
select * from t1 where a like "%a%";
23
select * from t1 where a like "%abcd%";
24
select * from t1 where a like "%abc\d%";
28
create table t1 (a varchar(10), key(a));
33
insert into t1 values ('a'), ('a\\b');
34
select * from t1 where a like 'a\\%' escape '#';
35
select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
38
# Bug #2885: like and datetime
42
create table t1 (a datetime);
43
insert into t1 values ('2004-03-11 12:00:21');
44
select * from t1 where a like '2004-03-11 12:00:21';