SQLite

View Ticket
Login
Ticket Hash: 135c9da7513e5a97c2b78b20d528ec8f77fe9b05
Title: Comparison of row values with COLLATE NOCASE yields incorrect result
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-10-23 18:09:50
Version Found In: 3.30.0
User Comments:
mrigger added on 2019-10-23 16:46:41:

Consider the following test case:

CREATE TABLE t0(c0 UNIQUE);
INSERT INTO t0(c0) VALUES('a');
SELECT * FROM t0 WHERE (t0.c0, 0) < ('B' COLLATE NOCASE, 0); -- unexpected: row is not fetched

Unexpectedly, the row is not fetched, even though the expression seems to evaluate to TRUE:

SELECT (t0.c0, 0) < ('B' COLLATE NOCASE, 0) FROM t0; -- 1