Query result is incorrect when WHERE clause is "where userID-2>2 || (userID+spID)/3<>0 && score MOD 2 > 0" #789
Labels
kind/bug
Something isn't working
priority/p1
Medium priority feature that should be implemented in this version
severity/s1
High impact: Logical errors or data errors that must occur
triage/accepted
Milestone
Can be reproduced ?
Yes
Steps:
Run SQL below:
CREATE TABLE t1 (spID int,userID int,score smallint);
INSERT INTO t1 VALUES (1,1,1);
INSERT INTO t1 VALUES (2,2,2);
INSERT INTO t1 VALUES (2,1,4);
INSERT INTO t1 VALUES (3,3,3);
INSERT INTO t1 VALUES (1,1,5);
INSERT INTO t1 VALUES (4,6,10);
INSERT INTO t1 VALUES (5,11,99);
select * from t1 where userID-2>2 || (userID+spID)/3<>0 && score MOD 2 > 0;
Expected behavior:
mysql> select * from t1 where userID-2>2 || (userID+spID)/3<>0 && score MOD 2 > 0;
+------+--------+-------+
| spID | userID | score |
+------+--------+-------+
| 1 | 1 | 1 |
| 3 | 3 | 3 |
| 1 | 1 | 5 |
| 4 | 6 | 10 |
| 5 | 11 | 99 |
+------+--------+-------+
5 rows in set, 2 warnings (0.00 sec)
Actual behavior:
mysql> select * from t1 where userID-2>2 || (userID+spID)/3<>0 && score MOD 2 > 0;
+--------+------+-------+
| userID | spID | score |
+--------+------+-------+
| 3 | 3 | 3 |
| 6 | 4 | 10 |
| 11 | 5 | 99 |
+--------+------+-------+
3 rows in set (0.01 sec)
Environment:
Configuration file:
Additional context:
The text was updated successfully, but these errors were encountered: