SQLite

View Ticket
Login
Ticket Hash: b86894020e985dc5a9392a1f073f90150120a707
Title: DISTINCT malfunctions for IS NULL
Status: Closed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-08-21 14:55:33
Version Found In: 3.29.0
User Comments:
mrigger added on 2019-08-21 11:50:19:

In the following test case, a row is unexpectedly not fetched.

CREATE TABLE t0 (c0, c1 NOT NULL DEFAULT 1, c2, PRIMARY KEY (c0, c1));
INSERT INTO t0(c2) VALUES (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL), (NULL);
INSERT INTO t0(c2) VALUES ('a');
ANALYZE t0;
SELECT DISTINCT * FROM t0 WHERE NULL IS t0.c0; -- unexpected: |1|a is not part of the result set

Note that changing NULL IS t0.c0 to t0.c0 IS NULL results in the query working correctly.


dan added on 2019-08-21 14:55:33:

Fixed by [d02490a2].