Bug #75896 | Undesired boolean coercion: WHERE id = 1 OR 2 | ||
---|---|---|---|
Submitted: | 13 Feb 2015 15:12 | Modified: | 13 May 2015 9:38 |
Reporter: | Morgan Tocker | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S4 (Feature request) |
Version: | 5.7.6, 5.7.8, 8.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[13 Feb 2015 15:12]
Morgan Tocker
[13 May 2015 9:37]
MySQL Verification Team
Hello Morgan, Thank you for report. Thanks, Umesh
[7 Oct 2015 19:49]
Simon Mudd
Note: I think the where clause here is where (id = 1) or 2 as = has higher precedence over 'or' (see: https://dev.mysql.com/doc/refman/5.7/en/operator-precedence.html) and ideally the 2 should not match as a boolean comparison so maybe should fail. Some implicit type conversions just cause trouble. MySQL is famous for this and usually it works but when it doesn't you may not notice and you may not get the results you expect.