Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
-
10.2.1-5
Description
This script:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a INT); |
INSERT INTO t1 VALUES (10); |
SELECT 1 UNION (SELECT 2 FROM t1 GROUP BY 1 WITH ROLLUP); |
returns a wrong error message:
ERROR 1221 (HY000): Incorrect usage of CUBE/ROLLUP and ORDER BY
|
If I remove parentheses:
SELECT 1 UNION SELECT 2 FROM t1 GROUP BY 1 WITH ROLLUP; |
it returns a result:
+------+
|
| 1 |
|
+------+
|
| 1 |
|
| 2 |
|
| NULL |
|
+------+
|
If I rewrite the query the other way around:
(SELECT 1 FROM t1 GROUP BY 1 WITH ROLLUP) UNION SELECT 2; |
it returns a result:
+------+
|
| 1 |
|
+------+
|
| 1 |
|
| NULL |
|
| 2 |
|
+------+
|
Attachments
Issue Links
- blocks
-
MDEV-8909 union parser cleanup
- Closed