summaryrefslogtreecommitdiff
path: root/mysql-test/r/union.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/union.result')
-rw-r--r--mysql-test/r/union.result20
1 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 25de5ee4648..6d086163aff 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1915,6 +1915,26 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
drop table t1;
#
+# MDEV-6868:MariaDB server crash ( select with union and order by
+# with subquery )
+#
+CREATE TABLE t1 ( id INTEGER, sample_name1 VARCHAR(100), sample_name2 VARCHAR(100), PRIMARY KEY(id) );
+INSERT INTO t1 ( id, sample_name1, sample_name2 ) VALUES ( 1, 'aaaa', 'bbbb' ), ( 2, 'cccc', 'dddd' );
+(
+SELECT sample_name1 AS testname FROM t1
+)
+UNION
+(
+SELECT sample_name2 AS testname FROM t1 C ORDER BY (SELECT T.sample_name1 FROM t1 T WHERE T.id = C.id)
+)
+;
+testname
+aaaa
+cccc
+bbbb
+dddd
+drop table t1;
+#
# WL#1763 Avoid creating temporary table in UNION ALL
#
EXPLAIN SELECT 1 UNION ALL SELECT 1 LIMIT 1 OFFSET 1;