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

Fixed bug with HEAP tables when using LIKE

This commit is contained in:
monty@donna.mysql.fi
2001-04-16 14:05:55 +03:00
parent 801259b669
commit ac77076ff2
5 changed files with 84 additions and 9 deletions

View File

@ -78,3 +78,10 @@ f1 f2
12 ted
12 ted
12 ted
table type possible_keys key key_len ref rows Extra
t1 range btn btn 10 NULL 10 where used
btn
table type possible_keys key key_len ref rows Extra
t1 ALL btn NULL NULL NULL 14 where used
table type possible_keys key key_len ref rows Extra
t1 ref btn btn 11 const,const 10 where used

View File

@ -2,6 +2,7 @@
# Test of heap tables.
#
drop table if exists t1;
create table t1 (a int not null,b int not null, primary key (a)) type=heap comment="testing heaps" avg_row_length=100 min_rows=1 max_rows=100;
insert into t1 values(1,1),(2,2),(3,3),(4,4);
delete from t1 where a=1 or a=0;
@ -85,3 +86,17 @@ INSERT into t1 set f1=12,f2="ted";
delete from t1 where f2="bill";
select * from t1;
drop table t1;
#
# Test when using part key searches
#
create table t1 (btn char(10) not null, key(btn)) type=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%";
select * from t1 where btn like "q%";
alter table t1 add column new_col char(1) not null, add key (btn,new_col), drop key btn;
update t1 set new_col=btn;
explain select * from t1 where btn="a";
explain select * from t1 where btn="a" and new_col="a";
drop table t1;