From 5b8c42d91d3d709ffa4fca27f4199e52f72ca38e Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 8 Apr 2010 13:55:17 -0700 Subject: [PATCH] Fixed a problem of merge from mysql-5.1 baseline. --- sql/sql_select.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c326b2770a9..e3b34126828 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2335,7 +2335,13 @@ JOIN::destroy() tab->cleanup(); } tmp_join->tmp_join= 0; + /* + We need to clean up tmp_table_param for reusable JOINs (having non-zero + and different from self tmp_join) because it's not being cleaned up + anywhere else (as we need to keep the join is reusable). + */ tmp_table_param.cleanup(); + tmp_join->tmp_table_param.copy_field= 0; DBUG_RETURN(tmp_join->destroy()); } cond_equal= 0;