From e7c25ed4a1b086e208a6fa6b7ee1ab0cc50c41b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 18 Jan 2006 13:48:57 +0200 Subject: Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851). mysql-test/r/kill.result: BUG#14851 test mysql-test/t/kill.test: BUG#14851 test sql/sql_class.cc: Debug prints are added. sql/sql_select.cc: Allocation of tmp_join fixed to involve constructor (it is not related to the bug directly but might cause other problems). Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851). sql/sql_select.h: JOINs constructor added, initialization of them fixed (it is not related to the bug directly but might cause other problems). --- sql/sql_select.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'sql/sql_select.cc') diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5ef3f4d9fda..aca2c72f1ea 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -4107,6 +4107,20 @@ JOIN::join_free(bool full) problems in free_elements() as some of the elements are then deleted. */ tmp_table_param.copy_funcs.empty(); + /* + If we have tmp_join and 'this' JOIN is not tmp_join and + tmp_table_param.copy_field's of them are equal then we have to remove + pointer to tmp_table_param.copy_field from tmp_join, because it qill + be removed in tmp_table_param.cleanup(). + */ + if (tmp_join && + tmp_join != this && + tmp_join->tmp_table_param.copy_field == + tmp_table_param.copy_field) + { + tmp_join->tmp_table_param.copy_field= + tmp_join->tmp_table_param.save_copy_field= 0; + } tmp_table_param.cleanup(); } DBUG_VOID_RETURN; -- cgit v1.2.1