Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 12.3, 11.8.8, 11.8.9
Description
the derived table `(SELECT t0.c0 AS c1 FROM t0, t2)` contributes the single constant `10`, so the predicate `t1.c0 < subq0.c1` should keep both outer rows `1` and `3`. Each output row must therefore carry `MIN(subq0.c1) OVER () = 10`. MariaDB instead drops all qualifying rows and returns an empty result.
CREATE TABLE t0(c0 BIGINT UNIQUE NOT NULL);
CREATE TABLE t1(c0 BIGINT UNIQUE NOT NULL);
CREATE TABLE t2(c0 BOOLEAN NOT NULL, PRIMARY KEY(c0));
INSERT INTO t0 VALUES (10);
INSERT INTO t1 VALUES (1), (3);
INSERT INTO t2 VALUES (TRUE);
SELECT MIN(subq0.c1) OVER (), t1.c0
FROM t1,
(SELECT t0.c0 AS c1 FROM t0, t2) AS subq0
WHERE (t1.c0 < subq0.c1); – Expected correct result: 10 | 1 ; 10 | 3 – actual Wrong result: <empty>
Attachments
Issue Links
- is duplicated by
-
MDEV-39869 AVG over a field exported from an inner subquery saturates instead of returning the exact one-row value
-
- Closed
-
- relates to
-
MDEV-39730 COUNT(expr) OVER() counts a NULL-extended constant from an empty derived table
-
- Confirmed
-