Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 11.8.8
Description
`t2` is empty, so the query can only produce one NULL-extended group from the `RIGHT JOIN`. On that group `MAX(t0.c0)` is `'1464731614'`, and `'1464731614' LIKE 'z]>4'` is false, so the `HAVING` clause should filter the group out and return an empty result. MariaDB instead wrongly keeps the group and returns `10 | '' | NULL | 1464731614 | 1`.
CREATE TABLE t0(c0 CHAR(100) NOT NULL, PRIMARY KEY(c0));
CREATE TABLE t2 LIKE t0;
INSERT INTO t0 VALUES ('1464731614');
SELECT LENGTH(t0.c0), IFNULL(t2.c0, ''), MAX(t2.c0), MAX(t0.c0), COUNT(1) OVER ()
FROM t2
RIGHT JOIN t0
ON ((t2.c0 != t0.c0) AND (t0.c0 IS NOT NULL) AND (t2.c0 IS NULL))
GROUP BY LENGTH(t0.c0), IFNULL(t2.c0, '')
HAVING (MAX(t0.c0) LIKE 'z]>4')
ORDER BY IFNULL(t2.c0, ''); – Expected correct result: <empty> – actual Wrong result: 10 | | NULL | 1464731614 | 1
Attachments
Issue Links
- relates to
-
MDEV-39730 COUNT(expr) OVER() counts a NULL-extended constant from an empty derived table
-
- Confirmed
-
-
MDEV-39866 MIN over an empty Aria-backed derived table leaks the inner COALESCE fallback value'
-
- Confirmed
-