summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2002-04-02 20:08:55 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2002-04-02 20:08:55 +0300
commit95ac82521c97fa257507118a13410f2e5229d91d (patch)
tree1bce2533c383be2ab3523d0665e59a22cc7f79df /mysql-test
parent02695336bd5259e9a2558a025065faf905efb586 (diff)
downloadmariadb-git-95ac82521c97fa257507118a13410f2e5229d91d.tar.gz
Fix for a bug with EXPLAIN and (....) UNION (....) order by
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/union.result5
-rw-r--r--mysql-test/t/union.test1
2 files changed, 6 insertions, 0 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index ef82b414420..76f09d6b330 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -84,6 +84,11 @@ a b
3 c
2 b
1 a
+explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
+table type possible_keys key key_len ref rows Extra
+t1 ALL NULL NULL NULL NULL 4
+t2 ALL NULL NULL NULL NULL 4 Using filesort
+t1 ALL NULL NULL NULL NULL 4
explain select a,b from t1 union all select a,b from t2;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 086351e9da1..e62ca6d2700 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;
+explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
# Test some error conditions with UNION
explain select a,b from t1 union all select a,b from t2;