mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table
mysql-test/r/heap_hash.result: Testcase for BUG#8371: wrong rec_per_key value for hash index on temporary table mysql-test/t/heap_hash.test: Testcase for BUG#8371: wrong rec_per_key value for hash index on temporary table sql/ha_heap.cc: Fix for BUG#8371: wrong rec_per_key value for hash index on temporary table: Don't assume that table->rec_per_key==NULL if table->tmp_table != NO_TMP_TABLE, this is not true for tables created with "CREATE TEMPORARY TABLE" (while it holds for temporary tables created during query execution) sql/sql_select.cc: Initialize rec_per_key for all keys in temporary table.
This commit is contained in:
@ -355,3 +355,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ref heap_idx heap_idx 20 const 7 Using where
|
||||
1 SIMPLE t3 ref a a 40 func,const 6 Using where
|
||||
drop table t1, t2, t3;
|
||||
create temporary table t1 ( a int, index (a) ) engine=memory;
|
||||
insert into t1 values (1),(2),(3),(4),(5);
|
||||
select a from t1 where a in (1,3);
|
||||
a
|
||||
1
|
||||
3
|
||||
explain select a from t1 where a in (1,3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range a a 5 NULL 2 Using where
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user