SQLite

View Ticket
Login
Ticket Hash: fba33c8b1df6a91581cb9743d77b284451a650f4
Title: Partial index causes row to not be fetched in BETWEEN expression
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Rejected
Last Modified: 2019-08-30 15:11:19
Version Found In: 3.29.0
User Comments:
mrigger added on 2019-08-30 14:33:25:

The test case below demonstrates an issue where a row is not fetched:

CREATE TABLE t0(c1);
CREATE INDEX i0 ON t0(1) WHERE c1 NOTNULL;
INSERT INTO t0(c1) VALUES (NULL);
SELECT * FROM t0 WHERE t0.c1 IS FALSE BETWEEN FALSE AND TRUE; -- unexpected: row is not fetched

The expression should evaluate to TRUE:

SELECT t0.c1 IS FALSE BETWEEN FALSE AND TRUE IS TRUE FROM t0;