SQLite

View Ticket
Login
Ticket Hash: 29f635e0af71234be40dfc8d3d31bb7ff5b07a1a
Title: IS NULL unexpectedly evaluates to TRUE
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-09-03 13:35:00
Version Found In: 3.29.0
User Comments:
mrigger added on 2019-09-02 19:22:41:

Consider the test case below:

CREATE TABLE t0(c0 TEXT, c1 REAL, c2, PRIMARY KEY(c2, c0, c1));
CREATE INDEX i0 ON t0(c1 IN (c0));
INSERT INTO t0(c0, c2) VALUES (0, NULL) ON CONFLICT(c2, c1, c0) DO NOTHING;
UPDATE t0 SET c2 = x'';
SELECT * FROM t0 WHERE t0.c2 IS NULL; -- unexpected: row is fetched

The row is fetched, even though the WHERE condition should evaluate to FALSE:

SELECT t0.c2 IS NULL FROM t0; -- expected: FALSE


drh added on 2019-09-02 22:14:19:

The problem was introduced by a check-in earlier today that was itself a fix for ticket [2841e99d104c6436].