summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-12-02 20:18:51 +0200
committerunknown <Sinisa@sinisa.nasamreza.org>2002-12-02 20:18:51 +0200
commit47af809c617a9582a71ff0a13aeed4c74d848ef6 (patch)
tree374595893cfcdc147203da32bfac612391bffa8d /mysql-test
parent36429430c6bd18b7cccd459711ddd0ab30a2e63e (diff)
downloadmariadb-git-47af809c617a9582a71ff0a13aeed4c74d848ef6.tar.gz
Proper handling of ORDER BY table.column in UNION's
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/union.result5
-rw-r--r--mysql-test/t/union.test1
2 files changed, 2 insertions, 4 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 7a5e7d61940..02dda58d48f 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -85,10 +85,7 @@ a b
2 b
1 a
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
-a b
-1 a
-2 b
-3 c
+Table 't1' from one of SELECT's can not be used in order clause
explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 4
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 0b4e4943ba6..9ddfda7872f 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -20,6 +20,7 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
(select a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 4;
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
+--error 1248
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
#(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;