summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-11-13 14:43:09 -0800
committerIgor Babaev <igor@askmonty.org>2013-11-13 14:43:09 -0800
commitae40c7207760ea6c829a6bdbbabc1e19941f1240 (patch)
treeb16e5d9d06b4ccbd74d686715dcbe082f694f5ea /mysql-test/t/union.test
parent441192bfb0e620b49cb58eaef96132151531fc54 (diff)
downloadmariadb-git-ae40c7207760ea6c829a6bdbbabc1e19941f1240.tar.gz
Fixed bug mdev-5091.
The function SELECT_LEX::update_used_tables should process all ORDER BY lists in any subselect of a union.
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test19
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index fefd67fd2f7..bb0e5610a26 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1210,3 +1210,22 @@ execute stmt1;
deallocate prepare stmt1;
--echo End of 5.1 tests
+--echo #
+--echo # mdev-5091: Asseirtion failure for UNION with ORDER BY
+--echo # in one of selects
+--echo #
+
+ 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 );
+
+ DROP VIEW v1;
+ DROP TABLE t1;
+
+ --echo End of 5.3 tests
+