Bug #992 XOR operation gives incorrect results in WHERE part of the query
Submitted: 4 Aug 2003 12:40 Modified: 5 Aug 2003 7:01
Reporter: Sergey Petrunia Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:4.1 OS:Windows (windows 2000, RedHat 8.0)
Assigned to: Sergei Golubchik CPU Architecture:Any

[4 Aug 2003 12:40] Sergey Petrunia
Description:
One gets wrong query results when using XOR in WHERE part of the query. The  statement "TRUE XOR TRUE" seem to evaluate to TRUE when used in WHERE part. The same statement in other parts of the query (like SELECT (a XOR b ) AS cond ...) is correctly evaluated to FALSE.

How to repeat:
The simplest case is as follows:
CREATE TABLE t1 (f1 INT);
INSERT INTO t1 VALUES(1);
SELECT * FROM t1 WHERE TRUE XOR TRUE;
-- and 1 row will be returned, while empty set is expected.
-- The same happens when field values are used: the query
SELECT * FROM t1 WHERE (f1 =1) XOR (f1=1);
---will also return a row.
[5 Aug 2003 2:01] Alexander Keremidarski
Same with 4.0
[5 Aug 2003 7:01] Sergei Golubchik
Thank you for your bug report. This issue has been fixed in the latest
development tree for that product. You can find more information about
accessing our development trees at 
    http://www.mysql.com/doc/en/Installing_source_tree.html

fixed in 4.0.15