summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test21
1 files changed, 15 insertions, 6 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 707bda6d81b..9f747c9080f 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1184,11 +1184,11 @@ select 4
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval $my_stmt;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval prepare stmt1 from '$my_stmt';
-execute stmt1;
-execute stmt1;
let $my_stmt=
select 1 as foo
@@ -1201,13 +1201,11 @@ union
order by max(42) + max(1) + max(1) + max(1) + max(1) + max(1)
;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval $my_stmt;
+--error ER_AGGREGATE_ORDER_FOR_UNION
eval prepare stmt1 from '$my_stmt';
-execute stmt1;
-execute stmt1;
-
-deallocate prepare stmt1;
--echo End of 5.1 tests
@@ -1637,3 +1635,14 @@ eval $q;
eval EXPLAIN EXTENDED $q;
DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-10120: Wrong result of UNION .. ORDER BY GROUP_CONCAT()
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT t1 VALUES (1),(2),(3);
+
+--error ER_AGGREGATE_ORDER_FOR_UNION
+(SELECT 1 AS a) UNION (SELECT a FROM t1 GROUP BY a) ORDER BY GROUP_CONCAT(a);
+DROP TABLE t1;