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). --- sql/sql_union.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sql/sql_union.cc') diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 8088737c0de..f79ff7967db 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -148,6 +148,10 @@ int mysql_union(THD *thd, LEX *lex,select_result *result) { ha_rows records_at_start; lex->select=sl; +#if MYSQL_VERSION_ID < 40100 + if (describe && sl->linkage == NOT_A_SELECT) + break; // Skip extra item in case of 'explain' +#endif /* Don't use offset for the last union if there is no braces */ if (sl != lex_sl) { -- cgit v1.2.1