Bug #28694 multiple WHERE exclusions (<>) with many records and exclusions ignored
Submitted: 25 May 2007 21:50 Modified: 26 Jun 2007 0:39
Reporter: Jay Reeder Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.0.27 OS:Linux
Assigned to: CPU Architecture:Any
Tags: Incorrect Results

[25 May 2007 21:50] Jay Reeder
Description:
When running the following query:

SELECT lastapp AS Event, COUNT(*) AS event_count FROM cdr WHERE dst = '6783181300' OR dst = RIGHT('6783181300', 4) AND calldate between '2007-05-01 00:00:00' AND '2007-05-31 23:59:59' AND lastapp <> '' AND lastapp <> 'Call Rcvd' AND lastapp <> 'Goto Box' GROUP BY lastapp

if we run the above query and there are over 10,000 matching rows then only the 'Goto Box' exclusion is used.  Results with 'Call Rcvd' and '' for lastapp are counted and returned.

If we run the same query (above) and only 13 matching rows then all exclusions are implemented correctly.

How to repeat:
(see above)

Suggested fix:
(see above)
[26 May 2007 0:39] MySQL Verification Team
Thank you for the bug report. Could you please upgrade with latest released
version 5.0.41 many bugs were fixed since version 5.0.27 and let us know
the result you got. Thanks in advance.
[26 Jun 2007 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".