summaryrefslogtreecommitdiff
path: root/mysql-test/r/heap.result
diff options
context:
space:
mode:
authorunknown <pappa@c-5608e253.1238-1-64736c10.cust.bredbandsbolaget.se>2005-11-08 00:26:37 -0500
committerunknown <pappa@c-5608e253.1238-1-64736c10.cust.bredbandsbolaget.se>2005-11-08 00:26:37 -0500
commitbba73a091031e9c324fedd6ad1bb26bcd4e635f9 (patch)
treec9d5aa727d72266be0ab83ff53f139f4209b6e51 /mysql-test/r/heap.result
parent0e878d7e541983757bc0b31e7caa8a16a5fd2896 (diff)
downloadmariadb-git-bba73a091031e9c324fedd6ad1bb26bcd4e635f9.tar.gz
Bug #12796: Record lost in HEAP table
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
Diffstat (limited to 'mysql-test/r/heap.result')
-rw-r--r--mysql-test/r/heap.result12
1 files changed, 11 insertions, 1 deletions
diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result
index 53dec294ef8..e3b9f7db984 100644
--- a/mysql-test/r/heap.result
+++ b/mysql-test/r/heap.result
@@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL;
a b
explain SELECT * FROM t1 WHERE a IS NULL;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ref a a 5 const 1 Using where
+1 SIMPLE t1 ref a a 5 const 2 Using where
SELECT * FROM t1 WHERE a<=>NULL;
a b
NULL 99
@@ -296,3 +296,13 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
drop table t1;
+CREATE TABLE t1 (a int, key(a)) engine=heap;
+insert delayed into t1 values (0);
+delete from t1;
+select * from t1;
+a
+insert delayed into t1 values (0), (1);
+select * from t1 where a = 0;
+a
+0
+drop table t1;