From 612c83b845822e13a6653af3985c4e3395cb8259 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2004 18:21:25 +0400 Subject: Fix for bug#5138 continued: added comments, removed extra debug printf calls, changed ha_heap::records_in_range to use table->rec_per_key. heap/hp_block.c: Fix for bug#5138 continued: Added comments. heap/hp_delete.c: Fix for bug#5138 continued: Added comments. heap/hp_write.c: Fix for bug#5138 continued: Added comments, removed unneeded printf include/heap.h: Fix for bug#5138 continued: Added comments. mysql-test/r/heap_hash.result: Fix for bug#5138 continued: added FLUSH TABLES and rec_per_key estimates tests, updated test results mysql-test/t/heap_hash.test: Fix for bug#5138 continued: added FLUSH TABLES and rec_per_key estimates tests, updated test results sql/ha_heap.cc: Fix for bug#5138 continued: fixed comments to be correct removed unneded printf use TABLE::rec_per_key for records_in_range statistics --- mysql-test/t/heap_hash.test | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'mysql-test/t') diff --git a/mysql-test/t/heap_hash.test b/mysql-test/t/heap_hash.test index df233633840..6d8fdec4b9e 100644 --- a/mysql-test/t/heap_hash.test +++ b/mysql-test/t/heap_hash.test @@ -168,6 +168,14 @@ explain select * from t1 where a='aaab'; explain select * from t1 where a='aaac'; explain select * from t1 where a='aaad'; insert into t1 select * from t1; + +explain select * from t1 where a='aaaa'; +explain select * from t1 where a='aaab'; +explain select * from t1 where a='aaac'; +explain select * from t1 where a='aaad'; + +# a known effect: table reload causes statistics to be updated: +flush tables; explain select * from t1 where a='aaaa'; explain select * from t1 where a='aaab'; explain select * from t1 where a='aaac'; @@ -203,7 +211,6 @@ insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'), ('Suzy'), ('Hoppy'), ('Burrito'), ('Mimi'), ('Sherry'), ('Ben'), ('Phil'), ('Emily'), ('Mike'); insert into t2 select * from t1; - explain select * from t1 where name='matt'; explain select * from t2 where name='matt'; @@ -222,12 +229,11 @@ insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; insert into t1 (name) select name from t2; - +flush tables; select count(*) from t1 where name='Matt'; explain select * from t1 ignore index (btree_idx) where name='matt'; show index from t1; -flush tables; show index from t1; create table t3 @@ -238,8 +244,10 @@ create table t3 ) engine=heap; insert into t3 select name, name from t1; show index from t3; -flush tables; show index from t3; -drop table t1,t2; +# test rec_per_key use for joins. +explain select * from t1 ignore key(btree_idx), t3 where t1.name='matt' and t3.a = concat('',t1.name) and t3.b=t1.name; + +drop table t1, t2, t3; -- cgit v1.2.1