mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BTREE-indexes in HEAP tables can now be used to optimize ORDER BY
Don't read character set files if we are using only the default charset. In most cases the user will not anymore get a warning about missing character set files Compare strings with space extend instead of space strip. Now the following comparisons holds: "a" == "a " and "a\t" < "a". (Bug #3152). Note: Because of the above fix, one has to do a REPAIR on any table that has an ascii character < 32 last in a CHAR/VARCHAR/TEXT columns.
This commit is contained in:
@@ -173,9 +173,22 @@ f1 f2
|
||||
drop table t1;
|
||||
create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap;
|
||||
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
|
||||
explain select * from t1 where btn like "q%";
|
||||
explain select * from t1 where btn like "i%";
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
|
||||
1 SIMPLE t1 range btn btn 10 NULL 1 Using where
|
||||
explain select * from t1 where btn like "h%";
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range btn btn 10 NULL 4 Using where
|
||||
explain select * from t1 where btn like "a%";
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range btn btn 10 NULL 1 Using where
|
||||
explain select * from t1 where btn like "b%";
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range btn btn 10 NULL 1 Using where
|
||||
select * from t1 where btn like "ff%";
|
||||
btn
|
||||
select * from t1 where btn like " %";
|
||||
btn
|
||||
select * from t1 where btn like "q%";
|
||||
btn
|
||||
alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn;
|
||||
|
||||
Reference in New Issue
Block a user