Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
If select for creating view contains repeated column in GROUP BY and ROLLUP data in repeated columns are swapped.
Test:
CREATE TABLE t1 (a INT(10) NOT NULL, b INT(10) NOT NULL); |
INSERT INTO t1 VALUES (1, 1); |
INSERT INTO t1 VALUES (1, 2); |
|
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; |
|
CREATE VIEW v1 as SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; |
SELECT * FROM v1; |
|
DROP VIEW v1; |
DROP TABLE t1; |
Actual result:
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; |
a b c count |
1 1 1 1
|
1 1 NULL 1 |
1 2 1 1
|
1 2 NULL 1 |
1 NULL NULL 2 |
NULL NULL NULL 2 |
CREATE VIEW v1 as SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; |
SELECT * FROM v1; |
a b c count |
1 1 1 1
|
NULL 1 1 1 |
1 2 1 1
|
NULL 2 1 1 |
NULL NULL 1 2 |
NULL NULL 1 2 |
Expected result:
SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; |
a b c count |
1 1 1 1
|
1 1 NULL 1 |
1 2 1 1
|
1 2 NULL 1 |
1 NULL NULL 2 |
NULL NULL NULL 2 |
CREATE VIEW v1 as SELECT a, b, a AS c, COUNT(*) AS count FROM t1 GROUP BY a, b, c WITH ROLLUP; |
SELECT * FROM v1; |
a b c count |
1 1 1 1
|
1 1 NULL 1 |
1 2 1 1
|
1 2 NULL 1 |
1 NULL NULL 2 |
NULL NULL NULL 2 |
Attachments
Issue Links
- is part of
-
MDEV-27691 make working view-protocol
- Open