From 8838c971fa6ced3a8cb90c154bc5b9e0ec4bfba5 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Sep 2004 19:59:29 +0500 Subject: A fix (Bug #4980: union statement with () union () order by produces wrong explain). --- mysql-test/r/union.result | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mysql-test/r/union.result') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index 4b9555c334b..8f33bc4c316 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -88,7 +88,6 @@ explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a l 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 (select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2; a b 1 a @@ -424,8 +423,16 @@ create table t1 select a from t1 union select a from t2; INSERT TABLE 't1' isn't allowed in FROM table list select a from t1 union select a from t2 order by t2.a; Unknown column 't2.a' in 'ORDER BY' +drop table t1; drop table t1,t2; select length(version()) > 1 as `*` UNION select 2; * 1 2 +create table t1 (a int); +insert into t1 values (0), (3), (1), (2); +explain (select * from t1) union (select * from t1) order by a; +table type possible_keys key key_len ref rows Extra +t1 ALL NULL NULL NULL NULL 4 +t1 ALL NULL NULL NULL NULL 4 +drop table t1; -- cgit v1.2.1