summaryrefslogtreecommitdiff
path: root/mysql-test/r/union.result
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2014-11-15 22:18:33 +0100
committerunknown <sanja@askmonty.org>2014-11-15 22:18:33 +0100
commite7c356f7172cf0451eb4a1723623dfab54b8c3c3 (patch)
tree43583bbe16d9c60d666b27c789e1bbe4c30b2e77 /mysql-test/r/union.result
parent665a7c83b90dc01bcca0a78fd0e84bd64e252d7f (diff)
downloadmariadb-git-e7c356f7172cf0451eb4a1723623dfab54b8c3c3.tar.gz
MDEV-6868: MariaDB server crash ( select with union and order by with subquery )
Excluding ORDER BY condition should be done after preparation it (even to catch syntax errors).
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 4ecac34d9fa..40f5a77e3d0 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1935,3 +1935,23 @@ id select_type table type possible_keys key key_len ref rows Extra
3 UNION t1 ALL NULL NULL NULL NULL 4
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;