summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2016-04-09 17:03:48 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2016-04-09 17:03:48 +0200
commitcd776fedba3e2902bc25ee206d6e6266e7eb9411 (patch)
tree95bf82d0e0522c6af708cd28639c82e004b5a264 /sql/sql_union.cc
parentf884d233e6a5f68bab846a7bdbd041fc4415ad77 (diff)
parentd516a2ae0cbd09d3b5b1667ec62b421330ab9902 (diff)
downloadmariadb-git-10.2-connector-c-integ.tar.gz
Merge branch '10.2' into 10.2-connector-c-integ10.2-connector-c-integ
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 069eadc7519..5685c90850a 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -173,7 +173,8 @@ select_union::create_result_table(THD *thd_arg, List<Item> *column_types,
/**
- Reset and empty the temporary table that stores the materialized query result.
+ Reset and empty the temporary table that stores the materialized query
+ result.
@note The cleanup performed here is exactly the same as for the two temp
tables of JOIN - exec_tmp_table_[1 | 2].
@@ -183,8 +184,6 @@ void select_union::cleanup()
{
table->file->extra(HA_EXTRA_RESET_STATE);
table->file->ha_delete_all_rows();
- free_io_cache(table);
- filesort_free_buffers(table,0);
}
@@ -1161,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);