mirror of
https://github.com/MariaDB/server.git
synced 2025-11-13 21:42:58 +03:00
Two handler objects were present, one was used for an insert and the other for a select The state of the statistics was local to the handler object and thus the other handler object didn't notice the insert. Fix included: 1) Add a new variable key_stat_version added to whenever statistics was considered in need of update (previously key_stats_ok= FALSE in those places) 2) Add a new handler variable key_stat_version assigned whenever key_stats_ok= TRUE was set previously 3) Fix records_in_range to return records if records <= 1 4) Fix records_in_range to add 2 to rec_per_key to ensure we don't specify 0 or 1 when it isn't and thus invoking incorrect optimisations. 5) Fix unique key handling for HEAP table in records_in_range
21 lines
376 B
Plaintext
21 lines
376 B
Plaintext
#
|
|
# Test of heap tables.
|
|
#
|
|
|
|
--disable_warnings
|
|
drop table if exists t1;
|
|
--enable_warnings
|
|
|
|
#
|
|
# Bug 12796: Record doesn't show when selecting through index
|
|
#
|
|
CREATE TABLE t1 (a int, key(a)) engine=heap;
|
|
insert delayed into t1 values (0);
|
|
delete from t1;
|
|
select * from t1;
|
|
insert delayed into t1 values (0), (1);
|
|
select * from t1 where a = 0;
|
|
drop table t1;
|
|
|
|
# End of 4.1 tests
|