(text/x-fossil-wiki)
The fourth SELECT statement in the example below outputs one row where t1.a is
NULL. The first three SELECT statements demonstrate that the fourth
SELECT gives an is an incorrect result.
<blockquote><verbatim>
CREATE TABLE t1(a);
INSERT INTO t1 VALUES(NULL),(1);
SELECT '1:', typeof(a), a FROM t1 WHERE a<10;
SELECT '2:', typeof(a), a FROM t1 WHERE a+0<10;
CREATE INDEX t1x1 ON t1(a);
CREATE INDEX t1x2 ON t1(a+0);
SELECT '3:', typeof(a), a FROM t1 WHERE a<10;
SELECT '4:', typeof(a), a FROM t1 WHERE a+0<10;
</verbatim></blockquote>
|