summaryrefslogtreecommitdiff
path: root/mysql-test/r/ps.result
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-12-12 13:55:33 -0800
committerIgor Babaev <igor@askmonty.org>2013-12-12 13:55:33 -0800
commit3ec4296ec413e866c3efabc8dfa94172ad5f7c04 (patch)
treec34f3306a1671c4f672732bdc6a42133e080d5d3 /mysql-test/r/ps.result
parentfde2777b2722a2b81f995c74e74cc3e47c0f8788 (diff)
downloadmariadb-git-3ec4296ec413e866c3efabc8dfa94172ad5f7c04.tar.gz
Fixed bug mdev-5410.
The fix for bug #27937 was incomplete: it did not handle correctly the queries containing UNION with global ORDER BY in subselects.
Diffstat (limited to 'mysql-test/r/ps.result')
-rw-r--r--mysql-test/r/ps.result23
1 files changed, 23 insertions, 0 deletions
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index 75aef40b529..e5411b2a210 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -3284,4 +3284,27 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
deallocate prepare st;
drop table t1;
+#
+# Bug mdev-5410: crash at the execution of PS with subselect
+# formed by UNION with global ORDER BY
+#
+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);
+PREPARE stmt FROM "
+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;
+";
+EXECUTE stmt;
+c1
+NULL
+2
+EXECUTE stmt;
+c1
+NULL
+2
+DROP TABLE t1,t2;
# End of 5.3 tests