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.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 6c85840a5d1..5685c90850a 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1160,11 +1160,22 @@ List<Item> *st_select_lex_unit::get_unit_column_types()
return &sl->item_list;
}
+
+static void cleanup_order(ORDER *order)
+{
+ for (; order; order= order->next)
+ order->counter_used= 0;
+}
+
+
bool st_select_lex::cleanup()
{
bool error= FALSE;
DBUG_ENTER("st_select_lex::cleanup()");
+ cleanup_order(order_list.first);
+ cleanup_order(group_list.first);
+
if (join)
{
DBUG_ASSERT((st_select_lex*)join->select_lex == this);