summaryrefslogtreecommitdiff
path: root/mysql-test/t/view.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2017-06-16 16:24:36 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2017-06-22 15:04:43 +0200
commit9b7afd4188dfe5db64fbf8a58360b09f90f77fed (patch)
treed1e4ef0f97e0197d2e864ab6cb9589f3b2bcb03c /mysql-test/t/view.test
parentba9daddcd831e04be59bf1d60cb666624642f07c (diff)
downloadmariadb-git-9b7afd4188dfe5db64fbf8a58360b09f90f77fed.tar.gz
MDEV-12819 order by ordering expression changed to empty string when creatin view with union
prepare of "fake_select" for union made in JOIN::prepare only if we do not execute it then before reset, i.e it was for PS prepare and now required for CREATE VIEW to make global ORDER BY which belongs to "fake_select" prepared.
Diffstat (limited to 'mysql-test/t/view.test')
-rw-r--r--mysql-test/t/view.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 7a935838216..3ad7b9483ac 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5901,5 +5901,26 @@ drop view v1;
drop table t1;
--echo #
+--echo # MDEV-12819: order by ordering expression changed to empty string
+--echo # when creatin view with union
+--echo #
+
+create table t1 (t1col1 int, t1col2 int,t1col3 int );
+create table t2 (t2col1 int, t2col2 int, t2col3 int);
+
+create view v1 as
+select t1col1,t1col2,t1col3 from t1
+union all
+select t2col1,t2col2,t2col3 from t2
+order by 2,3;
+
+show create view v1;
+
+select * from v1;
+
+drop view v1;
+drop table t1,t2;
+
+--echo #
--echo # End of 10.1 tests
--echo #