summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <ram@gw.mysql.r18.ru>2004-09-03 19:59:29 +0500
committerunknown <ram@gw.mysql.r18.ru>2004-09-03 19:59:29 +0500
commit8838c971fa6ced3a8cb90c154bc5b9e0ec4bfba5 (patch)
tree2d229ece9ab6e399ce768d24026efbcd64481ad8 /sql/sql_union.cc
parentb871ea386c706a63bb53876d143d06e4109b4169 (diff)
downloadmariadb-git-8838c971fa6ced3a8cb90c154bc5b9e0ec4bfba5.tar.gz
A fix (Bug #4980: union statement with () union () order by produces wrong explain).
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc4
1 files changed, 4 insertions, 0 deletions
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)
{