Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Duplicate
-
11.2.2
-
None
-
Ubuntu 20.04
Description
When applying NOT twice to an integer in WHERE condition, the result is incorrect.
How to repeat:
CREATE TABLE t(a INT); |
INSERT INTO t VALUES (-1); |
SELECT * FROM t WHERE (NOT (NOT (a))) = -1; -- [-1] |
SELECT (NOT (NOT (a))) FROM t; -- [1] |
The same expression yields inconsistent results when appearing in the WHERE condition and projection list. I believe that the result of applying NOT twice to an integer should be 1 or 0 rather than the original value.
Attachments
Issue Links
- duplicates
-
MDEV-34498 Applying NOT twice on an integer results in wrong result in WHERE condition
- Confirmed