Vlad Shalnev wrote:

* from the manual:
>> Logical OR. Evaluates to 1 if any operand is non-zero, to NULL if any
>> operand is NULL, otherwise 0 is returned.

* Roger Baklund:
This definition (from the manual) is self-contradicting: 1 OR NULL
should evaluate to 1 because "any operand is non-zero", but it should
also evaluate to NULL because "any operand is NULL".

Why self-contradicting ?

It is self-contradicting because one part of the definition contradicts another part of the same definition.


> If you apply this rule as described ( from left
to right ) you will get correct result.

Definitions are usually not implemented left to right. Consider this definition: "The day can be devided into two parts: at night it is dark, in the day you can breathe." Implemented from left to right, it gives the "correct" answer, but that does not make it a good definition, mostly because the second part does not only fit the "day", it also fits the "night". A good definition is clear and unambiguous.


While we're at it: the term "non-zero"... what does it mean? As we all know, NULL != 0, and 0 == zero, consequently NULL must be non-zero.

I guess "non-false" or simply "true" would be more correct, as NULL evaluates to false in a boolean expression.

> And it isn't work in 4.1.7 :((

I don't know why the behaviour has changed. I suggest it is because the definition is unclear, but I don't know.

--
Roger


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to