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.result30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 75255d558c4..a3ad63c035a 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1721,6 +1721,36 @@ foo
deallocate prepare stmt1;
End of 5.1 tests
#
+# mdev-5091: Asseirtion failure for UNION with ORDER BY
+# in one of selects
+#
+CREATE TABLE t1 (i int, c char(1)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES (6,'b');
+CREATE VIEW v1 AS SELECT * FROM t1;
+( SELECT i FROM v1 GROUP BY i ORDER BY CONCAT( c, c ) LIMIT 1 )
+UNION
+( SELECT i FROM t1 );
+i
+6
+DROP VIEW v1;
+DROP TABLE t1;
+#
+# mdev-5382: UNION with ORDER BY in subselect
+#
+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;
+c1
+NULL
+2
+DROP TABLE t1,t2;
+End of 5.3 tests
+#
# Bug#57986 ORDER BY clause is not used after a UNION,
# if embedded in a SELECT
#