(text/x-fossil-wiki)
Consider the following test case:
<pre>
CREATE TABLE t0(c0 TEXT);
CREATE VIEW v0(c0) AS SELECT t0.c0 FROM t0;
INSERT INTO t0(c0) VALUES ('0');
SELECT 0 IN (c0) FROM v0; -- expected: 0, actual: 1
</pre>
The expression 0 in (c0) unexpectedly yields TRUE, although c0 is a string and 0 an integer; according to the documentation, values in the right list should have no affinity, so I would not expect an affinity conversion to be performed. When fetching from the table, rather than the view, the result is as expected:
<pre>
SELECT 0 IN (c0) FROM t0; -- 0
</pre>
|