diff options
author | unknown <mats@romeo.(none)> | 2007-02-26 17:44:55 +0100 |
---|---|---|
committer | unknown <mats@romeo.(none)> | 2007-02-26 17:44:55 +0100 |
commit | 236bb807330446e23733a895b937073cf325fb7e (patch) | |
tree | ae16b56efa7b45a7beb603a53d024a4de87db6af /sql/rpl_rli.h | |
parent | acc120071ce87c2456bb0db08d96e7714c3a1604 (diff) | |
download | mariadb-git-236bb807330446e23733a895b937073cf325fb7e.tar.gz |
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.
Diffstat (limited to 'sql/rpl_rli.h')
-rw-r--r-- | sql/rpl_rli.h | 15 |
1 files changed, 4 insertions, 11 deletions
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<gptr>(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; |