summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-04-16 14:05:55 +0300
committerunknown <monty@donna.mysql.fi>2001-04-16 14:05:55 +0300
commite5bd740dea6d55e15acc9d89990bb6c1909db40e (patch)
tree71b8dc7684015c297db3e01616c40cfa6acc6324 /mysql-test
parent4b570fc359635b216abd8852c31ac32cb35bae46 (diff)
downloadmariadb-git-e5bd740dea6d55e15acc9d89990bb6c1909db40e.tar.gz
Fixed bug with HEAP tables when using LIKE
Docs/manual.texi: Updated information about BDB tables. mysql-test/r/heap.result: Added test for HEAP bug mysql-test/t/heap.test: Added test for HEAP bug sql/field.cc: Fixed bug with HEAP tables sql/gen_lex_hash.cc: Smallare array
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/heap.result7
-rw-r--r--mysql-test/t/heap.test15
2 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index 1bf34c6ad1b..bf4c468c802 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -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
diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test
index cd21aaff77a..abb9e1fd1bc 100644
--- a/mysql-test/t/heap.test
+++ b/mysql-test/t/heap.test
@@ -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;