SQLite

View Ticket
Login
Ticket Hash: dbaf8a6820be1ece7e48a6b92febcaba39076f3b
Title: Unexpected affinity conversion is performed for the IN operator
Status: Fixed Type: Code_Defect
Severity: Important Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-08-27 17:01:25
Version Found In: 3.29.0
User Comments:
mrigger added on 2019-08-27 15:14:50: (text/x-fossil-wiki)
Unexpectedly, in the test case below, a row is fetched that should not be fetched:

<pre>
CREATE TABLE t0(c0 INT UNIQUE);
INSERT INTO t0(c0) VALUES (1);
SELECT * FROM t0 WHERE '1' IN (t0.c0); -- unexpected: fetches row
</pre>

The WHERE condition should yield FALSE, as demonstrated by the following statement:

<pre>
SELECT '1' IN (t0.c0) FROM t0; -- expected: 0
</pre>

When removing the UNIQUE constraint on the column, the query works as expected.