Details
Description
Consider the following test case:
CREATE TABLE t0(c0 INT); |
INSERT INTO t0(c0) VALUES(123); |
SELECT t0.c0 AS ref0 FROM t0 WHERE 1 = (NOT(NOT(t0.c0))); |
The query does not fetch any rows.
The expected result should be:
| ref0 |
|---|
| 123 |
The condition evaluates to true in the WHERE clause for the row in the table. This is verified as follows:
SELECT t0.c0, 1 = (NOT(NOT(t0.c0))) FROM t0; |
| t0.c0 | 1 = (NOT(NOT(t0.c0))) |
|---|---|
| 123 | 1 |
It is likely that the expression NOT(NOT(t0.c0)) was incorrectly optimized as t0.c0.
Attachments
Issue Links
- is duplicated by
-
MDEV-39728 A BOOLEAN != NOT NOT INT predicate evaluates false in projection but true in filtering
-
- Closed
-
-
MDEV-39731 A BOOLEAN != NOT NOT BOOLEAN predicate evaluates true in projection but false in filtering
-
- Closed
-
- relates to
-
MDEV-35435 Inconsistent behavior with NOT and ANY in WHERE Clause
-
- Confirmed
-
-
MDEV-37683 incorrect results for NOT operator on DATE_FORMAT with invalid arguments
-
- Confirmed
-
-
MDEV-39760 Logical query with ! (x LIKE x) NOT IN (x LIKE x) returns incorrect empty result set for valid DOUBLE values
-
- Confirmed
-