From 236bb807330446e23733a895b937073cf325fb7e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 26 Feb 2007 17:44:55 +0100 Subject: BUG#26634 (Valgrind failure in tree: memory loss for memory allocated in rpl_utility.h): Adding code to release allocated memory when tables_to_lock list is cleared. sql/log_event.cc: Using RPL_TABLE_LIST instead of TABLE_LIST for tables_to_lock. sql/rpl_rli.cc: Moving st_relay_log_info::clear_tables_to_lock() into rpl_rli.cc. Adding code to release memory allocated for saved table definition. sql/rpl_rli.h: Moving st_relay_log_info::clear_tables_to_lock() into rpl_rli.cc. Using RPL_TABLE_LIST instead of TABLE_LIST for tables_to_lock. sql/rpl_utility.h: Adding forward declarations. Adding boolean to tell if tabledef is valid. --- sql/rpl_rli.h | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'sql/rpl_rli.h') diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index cb9894a2125..45c9fb1cf96 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -20,6 +20,8 @@ #include "rpl_tblmap.h" +struct RPL_TABLE_LIST; + /**************************************************************************** @@ -279,7 +281,7 @@ typedef struct st_relay_log_info group_relay_log_pos); } - TABLE_LIST *tables_to_lock; /* RBR: Tables to lock */ + RPL_TABLE_LIST *tables_to_lock; /* RBR: Tables to lock */ uint tables_to_lock_count; /* RBR: Count of tables to lock */ table_mapping m_table_map; /* RBR: Mapping table-id to table */ @@ -295,16 +297,7 @@ typedef struct st_relay_log_info void transaction_end(THD*); void cleanup_context(THD *, bool); - void clear_tables_to_lock() { - while (tables_to_lock) - { - char *to_free= reinterpret_cast(tables_to_lock); - tables_to_lock= tables_to_lock->next_global; - tables_to_lock_count--; - my_free(to_free, MYF(MY_WME)); - } - DBUG_ASSERT(tables_to_lock == NULL && tables_to_lock_count == 0); - } + void clear_tables_to_lock(); time_t unsafe_to_stop_at; } RELAY_LOG_INFO; -- cgit v1.2.1