diff options
author | unknown <sanja@montyprogram.com> | 2012-10-02 12:53:20 +0300 |
---|---|---|
committer | unknown <sanja@montyprogram.com> | 2012-10-02 12:53:20 +0300 |
commit | 82eb2c6de05787cda48745bcf4225be7b5a9870e (patch) | |
tree | 8166ed4e2fbd438a4f8c67fed4ca7b84ef7a70a1 /mysql-test/r | |
parent | 807f537f328c284cd2834e8a860f39f516474ff6 (diff) | |
download | mariadb-git-82eb2c6de05787cda48745bcf4225be7b5a9870e.tar.gz |
fixed MDEV-568: Wrong result for a hash index look-up if the index is unique and the key is NULL
Check ability of index to be NULL as it made in MyISAM. UNIQUE with NULL could have several NULL entries so we have to continue even if ve have found a row.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/heap_hash.result | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/r/heap_hash.result b/mysql-test/r/heap_hash.result index bae49af462f..a0872fb09c5 100644 --- a/mysql-test/r/heap_hash.result +++ b/mysql-test/r/heap_hash.result @@ -382,3 +382,22 @@ INSERT INTO t1 VALUES('A ', 'A '); ERROR 23000: Duplicate entry 'A -A ' for key 'key1' DROP TABLE t1; End of 5.0 tests +# +# MDEV-568 (AKA LP BUG#1007981, AKA MySQL bug#44771) +# Wrong result for a hash index look-up if the index is unique and +# the key is NULL +# +CREATE TABLE t1 ( pk INT PRIMARY KEY, val INT, UNIQUE KEY USING HASH(val)) ENGINE=MEMORY; +INSERT INTO t1 VALUES (1, NULL); +INSERT INTO t1 VALUES (2, NULL); +INSERT INTO t1 VALUES (3, 1); +INSERT INTO t1 VALUES (4, NULL); +EXPLAIN SELECT * FROM t1 WHERE val IS NULL; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref val val 5 const 1 Using where +SELECT * FROM t1 WHERE val IS NULL; +pk val +4 NULL +2 NULL +1 NULL +drop table t1; |