On Thu, Dec 19, 2013 at 6:36 PM, RSmith <[email protected]> wrote:

>  my guess is the optimiser pounces directly on the fact that (X and 0)
> will always be 0
>

Correct.  The code is at

    http://www.sqlite.org/src/artifact/962c2988?ln=556-559

sqlite3ExprAnd() gets called to build the AND operator directly from the
parser, long before any name resolution has occurred, and indeed before the
expression has been fully parsed.  As long as one side or the other of the
AND operator does not have an egregious syntax error, if the other side
evaluates to FALSE then the whole expression is coded as a FALSE literal.

That code was added here:

    http://www.sqlite.org/src/info/f9a7e179cbbeeab5


-- 
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to