Details
-
Bug
-
Status: Open (View Workflow)
-
Critical
-
Resolution: Unresolved
-
11.2.2
-
None
-
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.