summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-12-13 13:00:38 +0100
committerSergei Golubchik <sergii@pisem.net>2013-12-13 13:00:38 +0100
commite68bccc743ddd5ee9b0e47ff73b57d088f015f17 (patch)
treef524c15c650c94dd8bab87899b04ae767544b5a2 /mysql-test/t/union.test
parentca083a764f14233dfd7f97436629020901bd23a6 (diff)
parent3ec4296ec413e866c3efabc8dfa94172ad5f7c04 (diff)
downloadmariadb-git-e68bccc743ddd5ee9b0e47ff73b57d088f015f17.tar.gz
5.3 merge
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index faa35de3ec1..a53427f7fc6 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1188,6 +1188,22 @@ deallocate prepare stmt1;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # mdev-5382: UNION with ORDER BY in subselect
+--echo #
+
+ CREATE TABLE t1 (a int DEFAULT NULL);
+ INSERT INTO t1 VALUES (2), (4);
+ CREATE TABLE t2 (b int DEFAULT NULL);
+ INSERT INTO t2 VALUES (1), (3);
+
+ SELECT c1 FROM (SELECT (SELECT a FROM t1 WHERE t1.a <= t2.b
+ UNION ALL
+ SELECT a FROM t1 WHERE t1.a+3<= t2.b
+ ORDER BY a DESC) AS c1 FROM t2) t3;
+
+ DROP TABLE t1,t2;
+
--echo End of 5.3 tests
--echo #