summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index be0430d4afe..724933e08d4 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -1205,6 +1205,8 @@ bool st_select_lex_unit::create_total_list_n_last_return(THD *thd, st_lex *lex,
net_printf(thd,ER_WRONG_USAGE,"UNION","ORDER BY");
return 1;
}
+ if (sl->linkage == DERIVED_TABLE_TYPE)
+ continue;
for (SELECT_LEX_UNIT *inner= sl->first_inner_unit();
inner;
inner= inner->next_unit())