On 19/08/2009 11:26 AM, Simon Slavin wrote:

> DRH's post trumps mine, of course.  I'm surprised to find that  
> brackets are optimised out of WHERE evaluations. 

Why? In the OP's example (all AND operators) the parentheses are 
redundant. In SQL, AND and OR are not guaranteed to be short-circuited; 
both operands may be evaluated. In a case like (a+b)*(c+d) the 
parentheses are necessary otherwise a+b*c+d would be interpreted as 
a+(b*c)+d. In parsing any expression in any language, one would expect 
unless documented otherwise that there was no other guarantee of order 
of evaluation -- if your expression has side-effects you are on your 
own. Generally parentheses are ignored immediately their purpose 
(overriding operator precedence) has been fulfilled.


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

Reply via email to