Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 11.8.6
Description
the inner derived table is exactly `(NULL, 2)` and `(NULL, 9)`, so after `GROUP BY c1` the unique group's `MAX(c4)` must be `9`. MariaDB instead computes `MAX(c4)` as `2`, so the outer predicate `m = 9` wrongly filters the only row away.
CREATE TABLE t1(c1 INT) ENGINE=MyISAM;
CREATE TABLE t2(c0 INT UNIQUE);
INSERT INTO t2 VALUES (9), (2);
SELECT 1
FROM (
SELECT MAX(subq0.c4) AS m, AVG(subq0.c4) OVER () AS a
FROM (
SELECT t1.c1, t2.c0 AS c4
FROM t2
LEFT JOIN t1
ON (FALSE)
) AS subq0
GROUP BY subq0.c1
) AS q
WHERE m = 9; – Expected correct result: 1 – actual Wrong result: <empty>
Attachments
Issue Links
- relates to
-
MDEV-39787 A self-join over an OR-filtered derived table computes MAX() OVER(PARTITION BY ...) as 2,3,3 instead of 3,3,3
-
- Confirmed
-
-
MDEV-39787 A self-join over an OR-filtered derived table computes MAX() OVER(PARTITION BY ...) as 2,3,3 instead of 3,3,3
-
- Confirmed
-