Bug #18070 Partitions: wrong result on WHERE ... IS NULL
Submitted: 8 Mar 2006 13:43 Modified: 29 Mar 2006 7:52
Reporter: Matthias Leich Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version:5.1 OS:
Assigned to: Sergei Glukhov CPU Architecture:Any

[8 Mar 2006 13:43] Matthias Leich
Description:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f_int1 INTEGER) PARTITION BY RANGE(f_int1)
(PARTITION p1 VALUES LESS THAN (0), PARTITION p2 VALUES LESS THAN (10));
INSERT INTO t1 SET f_int1 = NULL ;
SELECT * FROM t1;
f_int1
NULL
SELECT * FROM t1 WHERE f_int1 IS NULL;
f_int1
           <------ I miss the record.
DROP TABLE t1;
CREATE TABLE t1 (f_int1 INTEGER) PARTITION BY LIST(f_int1)
(PARTITION p1 VALUES IN (0), PARTITION p2 VALUES IN (NULL));
INSERT INTO t1 SET f_int1 = NULL ;
SELECT * FROM t1;
f_int1
NULL
SELECT * FROM t1 WHERE f_int1 IS NULL;
f_int1
           <--- I miss the record.
My environment:
   - Intel PC with Linux(SuSE 9.3)
   - MySQL compiled from source
         Version 5.1 last ChangeSet@1.2142.24.2, 2006-03-08

I took S1/P1 because too many real simple SELECTs will suffer 
from this bug.

How to repeat:
Please use my attached testscript ml1116.test
  copy it to mysql-test/t
  echo "Dummy" > r/ml1116.result   # Produce a dummy file with 
                                                   # expected results
  ./mysql-test-run ml1116
[8 Mar 2006 13:44] Matthias Leich
testscript

Attachment: ml1116.test (application/test, text), 595 bytes.

[14 Mar 2006 14:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/3829
[23 Mar 2006 10:46] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4061
[27 Mar 2006 13:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4194
[28 Mar 2006 12:21] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/4234
[28 Mar 2006 12:34] Sergei Glukhov
Fixed in 5.1.9
[29 Mar 2006 7:52] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented bugfix in 5.1.9 changelog. Closed.