Description:
A query result divergence occurs when evaluating an equivalent expression containing three-valued logic and IS NOT NULL checks on a DOUBLE column containing NULL.
How to repeat:
DROP TABLE IF EXISTS t;
CREATE TABLE t(c DOUBLE);
INSERT INTO t VALUES
(0),
(NULL);
-- Baseline Query (Returns 2 rows: 0, NULL)
SELECT * FROM t;
-- EET Equivalent Query (Incorrectly returns only 1 row: 0)
SELECT *
FROM t
WHERE NOT (
(
(
(c <=> NULLIF(-1, c))
OR
(c <= c)
)
AND NOT (
(c <=> NULLIF(-1, c))
OR
(c <= c)
)
AND (
(
(c <=> NULLIF(-1, c))
OR
(c <= c)
) IS NOT NULL
)
)
);
Expected Result:
The EET transformed query should return exactly 2 rows (0 and NULL), matching the baseline table count.
Actual Result:
The query returns only 1 row (0), incorrectly omitting the NULL row.
Description: A query result divergence occurs when evaluating an equivalent expression containing three-valued logic and IS NOT NULL checks on a DOUBLE column containing NULL. How to repeat: DROP TABLE IF EXISTS t; CREATE TABLE t(c DOUBLE); INSERT INTO t VALUES (0), (NULL); -- Baseline Query (Returns 2 rows: 0, NULL) SELECT * FROM t; -- EET Equivalent Query (Incorrectly returns only 1 row: 0) SELECT * FROM t WHERE NOT ( ( ( (c <=> NULLIF(-1, c)) OR (c <= c) ) AND NOT ( (c <=> NULLIF(-1, c)) OR (c <= c) ) AND ( ( (c <=> NULLIF(-1, c)) OR (c <= c) ) IS NOT NULL ) ) ); Expected Result: The EET transformed query should return exactly 2 rows (0 and NULL), matching the baseline table count. Actual Result: The query returns only 1 row (0), incorrectly omitting the NULL row.