From 0ba4ff24efe4e7816a1030f548ba12e685aa6e15 Mon Sep 17 00:00:00 2001 From: "gluh@mysql.com/gluh.(none)" <> Date: Wed, 23 Aug 2006 16:58:36 +0500 Subject: [PATCH] Bug#20548 Events: crash if InnoDB, multiple events, busy procedures, partitions setup 'share' struct for all partiton file elements. It's neccessary because we use m_file[0]->update_create_info(create_info) during ha_partition::update_create_info and 'share' for m_file[0] should be valid --- sql/ha_partition.cc | 11 +++++++++++ sql/ha_partition.h | 1 + sql/handler.h | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 615c4bfb1bf..b0580d784b0 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1579,6 +1579,17 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info) } +void ha_partition::change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) +{ + handler **file_array= m_file; + table= table_arg; + table_share= share; + do + { + (*file_array)->change_table_ptr(table_arg, share); + } while (*(++file_array)); +} + /* Change comments specific to handler diff --git a/sql/ha_partition.h b/sql/ha_partition.h index c62f21cfaa1..403a94a0c24 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -199,6 +199,7 @@ public: *no_parts= m_tot_parts; DBUG_RETURN(0); } + virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share); private: int prepare_for_delete(); int copy_partitions(ulonglong *copied, ulonglong *deleted); diff --git a/sql/handler.h b/sql/handler.h index 201a2f1980a..523a5db5356 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -983,7 +983,7 @@ public: virtual void print_error(int error, myf errflag); virtual bool get_error_message(int error, String *buf); uint get_dup_key(int error); - void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) + virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) { table= table_arg; table_share= share;