Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.11
-
None
-
Not for Release Notes
Description
In a GROUP BY ... WITH ROLLUP query, if the grouping argument is a function and is wrapped by a function in the SELECT-list, summary rows are not correctly indicated with NULL.
Query to reproduce:
CREATE TABLE t1 ( |
a INT, |
b INT |
);
|
|
|
INSERT INTO t1 VALUES |
(1, 1),
|
(1, 2),
|
(1, 3),
|
(2, 1),
|
(2, 2),
|
(2, 3);
|
|
|
SELECT a + a + 1, SUM(b) FROM t1 GROUP BY a + a WITH ROLLUP; |
MySQL result:
+-----------+--------+
|
| a + a + 1 | SUM(b) |
|
+-----------+--------+
|
| 3 | 6 |
|
| 5 | 6 |
|
| NULL | 12 |
|
+-----------+--------+
|
MariaDB result:
+-----------+--------+
|
| a + a + 1 | SUM(b) |
|
+-----------+--------+
|
| 3 | 6 |
|
| 5 | 6 |
|
| 5 | 12 |
|
+-----------+--------+
|
Attachments
Issue Links
- duplicates
-
MDEV-19039 Wrong result from query, using window function and GROUP BY .. WITH ROLLUP
-
- Stalled
-