1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for a bug with EXPLAIN and (....) UNION (....) order by

This commit is contained in:
Sinisa@sinisa.nasamreza.org
2002-04-02 20:08:55 +03:00
parent 2f7a8c0f04
commit b98a84a19f
3 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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;