summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <timour@askmonty.org>2010-04-06 00:15:15 +0300
committerunknown <timour@askmonty.org>2010-04-06 00:15:15 +0300
commit3b05fc78e5dceebaa47c10d36ba667fb7be38fac (patch)
tree1ea66b0fcf606058c81d608a2cb51debb3d6b6cd /sql/sql_union.cc
parent3fc85580c9bc1e585de752697e3ae7ad02a64957 (diff)
downloadmariadb-git-3b05fc78e5dceebaa47c10d36ba667fb7be38fac.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 ee9ff833726..1080b45d60d 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()