summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index d9e19571f81..f6006a87d47 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -39,8 +39,11 @@ explain select a,b from t1 union all select a,b from t2;
--error 1054
explain select xx from t1 union select 1;
+--error 1222
explain select a,b from t1 union select 1;
+--error 1222
explain select 1 union select a,b from t1 union select 1;
+--error 1222
explain select a,b from t1 union select 1 limit 0;
--error 1221
@@ -515,3 +518,12 @@ SET SQL_SELECT_LIMIT=1;
select a from t1 union select a from t2 order by a;
drop table t1, t2;
set sql_select_limit=default;
+
+#
+# nonexisting column in global ORDER BY
+#
+CREATE TABLE t1 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
+CREATE TABLE t2 (i int(11) default NULL,c char(1) default NULL,KEY i (i));
+--error 1054
+explain (select * from t1) union (select * from t2) order by not_existing_column;
+drop table t1, t2;