Bug #340 | Where clause issue | ||
---|---|---|---|
Submitted: | 28 Apr 2003 8:41 | Modified: | 28 Apr 2003 8:48 |
Reporter: | Jeff Ortel | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 3.23 | OS: | Windows (Win2000) |
Assigned to: | CPU Architecture: | Any |
[28 Apr 2003 8:41]
Jeff Ortel
[28 Apr 2003 8:48]
Guilhem Bichot
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php where -> (upper(a.firstname) like upper('%jo%') or -> upper(a.alias) like upper('%jo%') or -> upper(a.lastname) like upper('%jo%') or -> upper(a.email) like upper('%jo%')) or -> (upper(a.firstname) like upper('%j%') and -> upper(a.lastname) like upper('%j%')) or -> (upper(a.alias) like upper('%j%') and -> upper(a.lastname) like upper('%o%')) and -> a.id in (13,16) AND has higher priority than OR, so what you're doing is like WHERE (...) OR (...) OR (... AND ...) hence the problem. Rewrite it to WHERE (... OR ... OR ...) AND ...