/ View Ticket
Login
Ticket Hash: 6ef984af8972c2eb984d9dda06e1f62092bcb3ed
Title: Row value comparison yields incorrect result
Status: Fixed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-10-22 19:51:41
Version Found In: 3.30.0
User Comments:
mrigger added on 2019-10-22 14:05:01: (text/x-fossil-wiki)
Consider the following test case:

<pre>
CREATE TABLE t0(c0 TEXT PRIMARY KEY);
INSERT INTO t0(c0) VALUES ('');
SELECT * FROM t0 WHERE (t0.c0, TRUE) > (CAST('' AS REAL), FALSE); -- unexpected: row is not fetched
</pre>

Unexpectedly, the row is not fetched, although the WHERE clause seems to evaluate to TRUE:

<pre>
SELECT (t0.c0, TRUE) > (CAST(0 AS REAL), FALSE) FROM t0; -- 1
</pre>