Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.11, 11.4, 12.3, 11.8.6
-
Not for Release Notes
Description
For the only row `(t2.c0, t2.c1) = (TRUE, 1500534146)`, `NOT (NOT t2.c1)` is `1`, so `t2.c0 != (NOT (NOT t2.c1))` is `1 != 1`, i.e. false. MariaDB's own projection evaluation reports that value as false, so the `WHERE` clause that builds `join_temp_2` should reject the row. Instead, MariaDB keeps the row and the subsequent join returns `1500534146 | 1500534146`.
How to repeat:
CREATE TABLE t1(c0 INT);
CREATE TABLE t2(c0 BOOLEAN, c1 INT);
INSERT INTO t1 VALUES (0);
INSERT INTO t2 VALUES (TRUE, 1500534146);
CREATE TEMPORARY TABLE join_temp_2 (c0 TINYINT(1) NOT NULL, c1 INT NOT NULL);
INSERT INTO join_temp_2 SELECT * FROM t2 WHERE (t2.c0 != (NOT (NOT t2.c1)));
SELECT t2.c1, t2.c1
FROM t1 STRAIGHT_JOIN join_temp_2 AS t2
ON (t1.c0 < t2.c1); – Expected correct result: <empty> – actual Wrong result: 1500534146 | 1500534146
Attachments
Issue Links
- duplicates
-
MDEV-36440 Double negation is treated as original value in WHERE clause
-
- Confirmed
-
-
MDEV-39731 A BOOLEAN != NOT NOT BOOLEAN predicate evaluates true in projection but false in filtering
-
- Closed
-