summaryrefslogtreecommitdiff
path: root/mysql-test/r/union.result
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/r/union.result
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/r/union.result')
-rw-r--r--mysql-test/r/union.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 05dab9e2874..d4effc8448d 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1738,4 +1738,19 @@ 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