At 11:42 -0500 12/2/04, Michael Stassen wrote:
Roger Baklund wrote:
<snip>
This is (as I see it) a documentation issue, I was not trying to
say that Vlad was "wrong".
Right, that's why I'm copying the docs list.
I updated the description to account for the cases when there are 1 or 2
NULL operands. It should show up on the Web site soon.
Basically, the idea is that if there is a NULL operand, OR returns true
if the result can be determined to be true, and NULL otherwise.
1 OR NULL = 1
0 OR NULL = NULL
NULL OR NULL = NULL
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 would like to have a comment on this as well... or rather: I
wonder if anyone agrees with me that "non-zero" is a bad term to
use in this context (MySQL documentation, description of logical
operator OR), or if I am just overthinking again... :)
Well, if we imagined a NONZERO function, I think we would agree that
NONZERO(1) is 1, NONZERO(0) is 0, and NONZERO(NULL) is NULL
(for the usual reasons).
Of course, that doesn't mean that "non-zero" alone is the best way
to describe this in the docs. Perhaps something like this would be
better:
OR
||
Logical OR. Returns 1 if either operand evaluates to a non-zero
integer, else it returns NULL if either operand is NULL, otherwise 0
is returned.
or perhaps
OR
||
Logical OR. If either operand evaluates to a non-zero integer,
returns 1; else if either operand is NULL, returns NULL; otherwise 0
is returned.
Michael
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]