SQLite

View Ticket
Login
Ticket Hash: f096d191b6641daa8890490951ada43cff2be9a9
Title: Row value comparison malfunctions with rtree table
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-12-05 21:46:34
Version Found In: 3.30.0
User Comments:
mrigger added on 2019-12-05 15:08:06: (text/x-fossil-wiki)
Consider the following test case:

<pre>
CREATE TABLE t0(c0);
CREATE VIRTUAL TABLE rt0 USING rtree(c0, c1, c2);
INSERT INTO rt0(c2) VALUES(NULL);
INSERT INTO t0 VALUES(0);
SELECT * FROM rt0, t0 WHERE (t0.c0, 0) > (rt0.c2, 0); -- unexpected: row is fetched
</pre>

Unexpectedly, the row is fetched, even though the row value comparison should evaluate to FALSE:

<pre>
SELECT (t0.c0, 0) > (rt0.c2, 0) FROM rt0, t0; -- 0
</pre>