summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index f020168d742..c3635e24407 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -623,6 +623,12 @@ bool st_select_lex_unit::cleanup()
join->tables= 0;
}
error|= fake_select_lex->cleanup();
+ if (fake_select_lex->order_list.elements)
+ {
+ ORDER *ord;
+ for (ord= (ORDER*)fake_select_lex->order_list.first; ord; ord= ord->next)
+ (*ord->item)->cleanup();
+ }
}
DBUG_RETURN(error);