[MDEV-2430] LP:1007981 - Wrong result for a hash index look-up if the index is unique and the key is NULL Created: 2012-06-03 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major |
| Reporter: | Igor Babaev | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The MySQL reference (http://dev.mysql.com/doc/refman/5.0/en/create-index.html) says: According to the above a look-up into a unique index over a nullable column may return several records if the key value is null. MariaDB [test]> CREATE TABLE t1 MariaDB [test]> INSERT INTO t1 VALUES (1, NULL); MariaDB [test]> INSERT INTO t1 VALUES (2, NULL); MariaDB [test]> INSERT INTO t1 VALUES (3, 1); MariaDB [test]> INSERT INTO t1 VALUES (4, NULL); MariaDB [test]> EXPLAIN SELECT * FROM t1 WHERE val IS NULL;
---
--- MariaDB [test]> SELECT * FROM t1 WHERE val IS NULL;
---
--- MariaDB [test]> SELECT * FROM t1;
---
--- (see also http://bugs.mysql.com/bug.php?id=44771) |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2012-10-03 ] |
|
Launchpad bug id: 1007981 |