Bug #1828 | "OR" SQL operator is not cumutative under specific index | ||
---|---|---|---|
Submitted: | 13 Nov 2003 6:36 | Modified: | 28 Nov 2003 5:31 |
Reporter: | Nickolai Berezin | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 4.0.10 | OS: | Windows (Windows XP) |
Assigned to: | Alexey Botchkov | CPU Architecture: | Any |
[13 Nov 2003 6:36]
Nickolai Berezin
[13 Nov 2003 7:46]
Dean Ellis
Verified in 4.0.17 (Windows XP, Linux). Thank you. CREATE TABLE testing ( a int, b int, c int ) TYPE=MyISAM; INSERT INTO testing VALUES (1,0,0),(1,0,0),(1,0,0); INSERT INTO testing VALUES (0,1,0),(0,1,0),(0,1,0); -- Both report 6 SELECT COUNT(*) FROM testing WHERE (c=0 and a=1) or (c=0 and b=1); SELECT COUNT(*) FROM testing WHERE (c=0 and b=1) or (c=0 and a=1); ALTER TABLE testing ADD INDEX (c,a,b); -- First reports 3; second reports 6 SELECT COUNT(*) FROM testing WHERE (c=0 and a=1) or (c=0 and b=1); SELECT COUNT(*) FROM testing WHERE (c=0 and b=1) or (c=0 and a=1);
[21 Nov 2003 5:06]
Alexey Botchkov
bk commit - 4.1 tree (hf:1.1627)
[28 Nov 2003 5:31]
Michael Widenius
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Fix will be in 4.0.17 and 4.1.1 binary releases