1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

optimizer should check for "field LIKE const" not "field like STRING"

BitKeeper/etc/ignore:
  Added configure.lineno innobase/configure.lineno to the ignore list
This commit is contained in:
unknown
2003-03-02 14:07:32 +01:00
parent a2cc82182b
commit c5cd20fe8f
4 changed files with 27 additions and 8 deletions

View File

@ -1,10 +1,20 @@
drop table if exists t1;
create table t1 (a varchar(10), key(a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
explain select * from t1 where a like 'abc%';
table type possible_keys key key_len ref rows Extra
t1 range a a 11 NULL 1 Using where; Using index
explain select * from t1 where a like concat('abc','%');
table type possible_keys key key_len ref rows Extra
t1 range a a 11 NULL 1 Using where; Using index
select * from t1 where a like "abc%";
a
abc
abcd
select * from t1 where a like concat("abc","%");
a
abc
abcd
select * from t1 where a like "ABC%";
a
abc