Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 11.8.8
Description
the inner derived table `FROM t2, t0` is empty because `t2` is empty, so after the outer `LEFT JOIN` the only group's `MIN(subq0.c0)` must be NULL. MariaDB instead leaks the inner expression fallback `COALESCE(t0.c0, 857903360)` and returns `857903360`.
CREATE TABLE t0(c0 SMALLINT UNIQUE NOT NULL, PRIMARY KEY(c0)) ENGINE=Aria;
CREATE TABLE t1(c0 INT PRIMARY KEY);
CREATE TABLE t2(c0 INT);
INSERT INTO t1 VALUES (9292167);
SELECT MIN(subq0.c0)
FROM t1
LEFT JOIN (
SELECT COALESCE(t0.c0, 857903360) AS c0, t0.c0 AS c1
FROM t2, t0
) AS subq0
ON ((t1.c0 < subq0.c0) AND (subq0.c1 < -524306258) AND (subq0.c0 IS NULL))
GROUP BY COALESCE(subq0.c0, 1172511830); – Expected correct result: NULL – actual Wrong result: 857903360
Attachments
Issue Links
- relates to
-
MDEV-39730 COUNT(expr) OVER() counts a NULL-extended constant from an empty derived table
-
- Confirmed
-
-
MDEV-39865 A grouped NULL-extended RIGHT JOIN row survives a false HAVING predicate
-
- Confirmed
-