Unknown error when WHERE clause contains both "NOT" and "OR" operators #850
Labels
kind/bug
Something isn't working
kind/tech-request
New feature or request
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:
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 t1.userID<6 OR NOT t1.userID;
SELECT * FROM t1 where NOT t1.userID OR t1.userID<6;
SELECT * FROM t1 where NOT t1.userID || t1.userID<6;
Expected behavior:
mysql> SELECT * FROM t1 where NOT t1.userID || t1.userID<6;
+------+--------+-------+
| spID | userID | score |
+------+--------+-------+
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 2 | 1 | 4 |
| 3 | 3 | 3 |
| 1 | 1 | 5 |
+------+--------+-------+
5 rows in set, 1 warning (0.00 sec)
Actual behavior:
mysql> SELECT * FROM t1 where t1.userID<6 OR NOT t1.userID;
ERROR 1105 (HY000): unknown error:[42000][42000][42000]or not yet implemented for SEL, INT
mysql> SELECT * FROM t1 where NOT t1.userID OR t1.userID<6;
ERROR 1105 (HY000): unknown error:[42000][42000][42000]or not yet implemented for INT, SEL
mysql> SELECT * FROM t1 where NOT t1.userID || t1.userID<6;
ERROR 1105 (HY000): unknown error:[42000][42000][42000]or not yet implemented for INT, SEL
Environment:
Configuration file:
Additional context:
The text was updated successfully, but these errors were encountered: