SQLite

View Ticket
Login
Ticket Hash: 02aa2bd02f97d0f2ceba65c5e6580cdaa350a7ce
Title: Row value comparison malfunctions on view with left join
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-11-04 02:06:14
Version Found In: 3.30.0
User Comments:
mrigger added on 2019-11-03 10:51:47:

For the following test case, the row inserted into the table is not fetched by the subsequent query:

CREATE TABLE t0(c0);
CREATE TABLE t1(c0);
CREATE VIEW v0(c0) AS SELECT t0.c0 FROM t1 LEFT JOIN t0;
INSERT INTO t1(c0) VALUES (0);
SELECT * FROM v0 WHERE (v0.c0, x'') != (NULL, 0); -- unexpected: row is not fetched

I would expect the row to be fetched, since the comparison evaluates to TRUE:

SELECT (v0.c0, x'') != (NULL, 0) FROM v0; -- TRUE