summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-12-05 11:13:20 -0800
committerIgor Babaev <igor@askmonty.org>2013-12-05 11:13:20 -0800
commitccf5871d7bf8be15fcf9a03842a2f40337a7f72f (patch)
tree424e06c47bf894eaa49085dcf28b738758de95a4 /mysql-test/t/union.test
parent62e959437ee5bf64e89c7b16233ab2ca0fd8507c (diff)
downloadmariadb-git-ccf5871d7bf8be15fcf9a03842a2f40337a7f72f.tar.gz
Fixed bug mdev-5382
When marking used columns the function find_field_in_table_ref() erroneously called the walk method for the real item behind a view/derived table field with the second parameter set to TRUE. This erroneous code was introduced in 2006.
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 bb0e5610a26..bc995aac0a0 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1227,5 +1227,21 @@ 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