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 |
|
370.1.1
by arjen at com
Initial mods for making all tests work again. Some tests adapted+added. |
6 |
1 SIMPLE t1 index a a 13 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 |
|
370.1.1
by arjen at com
Initial mods for making all tests work again. Some tests adapted+added. |
11 |
1 SIMPLE t1 index a a 13 NULL 5 40.00 Using where; Using index |
1
by brian
clean slate |
12 |
Warnings: |
370.1.1
by arjen at com
Initial mods for making all tests work again. Some tests adapted+added. |
13 |
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` like 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; |
|
59 |
SET NAMES koi8r; |
|
60 |
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r); |
|
61 |
INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á'); |
|
62 |
INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏÌÄÖ'),('æÙ×ÁÐÒÏÌÄÖ'),('Æù×ÁÐÒÏÌÄÖ'),('ÆÙ÷ÁÐÒÏÌÄÖ'); |
|
63 |
INSERT INTO t1 VALUES ('ÆÙ×áÐÒÏÌÄÖ'),('ÆÙ×ÁðÒÏÌÄÖ'),('ÆÙ×ÁÐòÏÌÄÖ'),('ÆÙ×ÁÐÒïÌÄÖ'); |
|
64 |
INSERT INTO t1 VALUES ('ÆÙ×ÁÐÒÏìÄÖ'),('ÆÙ×ÁÐÒÏÌäÖ'),('ÆÙ×ÁÐÒÏÌÄö'),('æù÷áðòïìäö'); |
|
65 |
SELECT * FROM t1 WHERE a LIKE '%Æù×Á%'; |
|
66 |
a
|
|
67 |
ÆÙ×Á
|
|
68 |
æÙ×Á
|
|
69 |
Æù×Á
|
|
70 |
ÆÙ÷Á
|
|
71 |
ÆÙ×á
|
|
72 |
æù÷á
|
|
73 |
ÆÙ×ÁÐÒÏÌÄÖ
|
|
74 |
æÙ×ÁÐÒÏÌÄÖ
|
|
75 |
Æù×ÁÐÒÏÌÄÖ
|
|
76 |
ÆÙ÷ÁÐÒÏÌÄÖ
|
|
77 |
ÆÙ×áÐÒÏÌÄÖ
|
|
78 |
ÆÙ×ÁðÒÏÌÄÖ
|
|
79 |
ÆÙ×ÁÐòÏÌÄÖ
|
|
80 |
ÆÙ×ÁÐÒïÌÄÖ
|
|
81 |
ÆÙ×ÁÐÒÏìÄÖ
|
|
82 |
ÆÙ×ÁÐÒÏÌäÖ
|
|
83 |
ÆÙ×ÁÐÒÏÌÄö
|
|
84 |
æù÷áðòïìäö
|
|
85 |
SELECT * FROM t1 WHERE a LIKE '%Æù×%'; |
|
86 |
a
|
|
87 |
ÆÙ×Á
|
|
88 |
æÙ×Á
|
|
89 |
Æù×Á
|
|
90 |
ÆÙ÷Á
|
|
91 |
ÆÙ×á
|
|
92 |
æù÷á
|
|
93 |
ÆÙ×ÁÐÒÏÌÄÖ
|
|
94 |
æÙ×ÁÐÒÏÌÄÖ
|
|
95 |
Æù×ÁÐÒÏÌÄÖ
|
|
96 |
ÆÙ÷ÁÐÒÏÌÄÖ
|
|
97 |
ÆÙ×áÐÒÏÌÄÖ
|
|
98 |
ÆÙ×ÁðÒÏÌÄÖ
|
|
99 |
ÆÙ×ÁÐòÏÌÄÖ
|
|
100 |
ÆÙ×ÁÐÒïÌÄÖ
|
|
101 |
ÆÙ×ÁÐÒÏìÄÖ
|
|
102 |
ÆÙ×ÁÐÒÏÌäÖ
|
|
103 |
ÆÙ×ÁÐÒÏÌÄö
|
|
104 |
æù÷áðòïìäö
|
|
105 |
SELECT * FROM t1 WHERE a LIKE 'Æù×Á%'; |
|
106 |
a
|
|
107 |
ÆÙ×Á
|
|
108 |
æÙ×Á
|
|
109 |
Æù×Á
|
|
110 |
ÆÙ÷Á
|
|
111 |
ÆÙ×á
|
|
112 |
æù÷á
|
|
113 |
ÆÙ×ÁÐÒÏÌÄÖ
|
|
114 |
æÙ×ÁÐÒÏÌÄÖ
|
|
115 |
Æù×ÁÐÒÏÌÄÖ
|
|
116 |
ÆÙ÷ÁÐÒÏÌÄÖ
|
|
117 |
ÆÙ×áÐÒÏÌÄÖ
|
|
118 |
ÆÙ×ÁðÒÏÌÄÖ
|
|
119 |
ÆÙ×ÁÐòÏÌÄÖ
|
|
120 |
ÆÙ×ÁÐÒïÌÄÖ
|
|
121 |
ÆÙ×ÁÐÒÏìÄÖ
|
|
122 |
ÆÙ×ÁÐÒÏÌäÖ
|
|
123 |
ÆÙ×ÁÐÒÏÌÄö
|
|
124 |
æù÷áðòïìäö
|
|
125 |
DROP TABLE t1; |
|
126 |
SET NAMES cp1250; |
|
127 |
CREATE TABLE t1 (a varchar(250) NOT NULL) DEFAULT CHARACTER SET=cp1250; |
|
128 |
INSERT INTO t1 VALUES |
|
129 |
('Techni Tapes Sp. z o.o.'), |
|
130 |
('Pojazdy Szynowe PESA Bydgoszcz SA Holding'), |
|
131 |
('AKAPESTER 1 P.P.H.U.'), |
|
132 |
('Pojazdy Szynowe PESA Bydgoszcz S A Holding'), |
|
133 |
('PPUH PESKA-I Maria Struniarska'); |
|
134 |
select * from t1 where a like '%PESA%'; |
|
135 |
a
|
|
136 |
Pojazdy Szynowe PESA Bydgoszcz SA Holding |
|
137 |
Pojazdy Szynowe PESA Bydgoszcz S A Holding |
|
138 |
select * from t1 where a like '%PESA %'; |
|
139 |
a
|
|
140 |
Pojazdy Szynowe PESA Bydgoszcz SA Holding |
|
141 |
Pojazdy Szynowe PESA Bydgoszcz S A Holding |
|
142 |
select * from t1 where a like '%PES%'; |
|
143 |
a
|
|
144 |
Techni Tapes Sp. z o.o. |
|
145 |
Pojazdy Szynowe PESA Bydgoszcz SA Holding |
|
146 |
AKAPESTER 1 P.P.H.U. |
|
147 |
Pojazdy Szynowe PESA Bydgoszcz S A Holding |
|
148 |
PPUH PESKA-I Maria Struniarska |
|
149 |
select * from t1 where a like '%PESKA%'; |
|
150 |
a
|
|
151 |
PPUH PESKA-I Maria Struniarska |
|
152 |
select * from t1 where a like '%ESKA%'; |
|
153 |
a
|
|
154 |
PPUH PESKA-I Maria Struniarska |
|
155 |
DROP TABLE t1; |
|
156 |
select _cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin; |
|
157 |
_cp866'aaaaaaaaa' like _cp866'%aaaa%' collate cp866_bin |
|
158 |
1
|
|
159 |
set names koi8r; |
|
160 |
select 'andre%' like 'andreÊ%' escape 'Ê'; |
|
161 |
'andre%' like 'andreÊ%' escape 'Ê' |
|
162 |
1
|
|
163 |
select _cp1251'andre%' like convert('andreÊ%' using cp1251) escape 'Ê'; |
|
164 |
_cp1251'andre%' like convert('andreÊ%' using cp1251) escape 'Ê' |
|
165 |
1
|