summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2010-07-16 14:02:15 +0300
committerunknown <timour@askmonty.org>2010-07-16 14:02:15 +0300
commit2d78ffb8d54323d7908c3086f68093c049663318 (patch)
tree78edfa5c3e8b07f32b435971c53838a5d4833614 /sql/sql_union.cc
parent75bba30c5a0e65e3f5501492603370c7afc9444b (diff)
downloadmariadb-git-2d78ffb8d54323d7908c3086f68093c049663318.tar.gz
Fixed a problem where the temp table of a materialized subquery
was not cleaned up between PS re-executions. The reason was two-fold: - a merge with mysql-6.0 missed select_union::cleanup() that should have cleaned up the temp table, and - the subclass of select_union used by materialization didn't call the base class cleanup() method.
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 21fe3de4c17..374e92c6a52 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -136,6 +136,22 @@ select_union::create_result_table(THD *thd_arg, List<Item> *column_types,
}
+/**
+ 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].
+*/
+
+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);
+}
+
+
/*
initialization procedures before fake_select_lex preparation()