summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.h
diff options
context:
space:
mode:
authorunknown <mats@mysql.com>2006-05-09 12:30:06 +0200
committerunknown <mats@mysql.com>2006-05-09 12:30:06 +0200
commit221890f8dec311aaf4b33c39cc9d76dabf63059f (patch)
tree085904643653a88f9525fef077c4e3604a585657 /sql/rpl_rli.h
parent94c6f6dc4888166b3677f38b534502156ef50d49 (diff)
downloadmariadb-git-221890f8dec311aaf4b33c39cc9d76dabf63059f.tar.gz
Plugging memory leak in row-based replication triggered by
test rpl_err_ignoredtables. sql/log_event.cc: Clearing tables to lock list in the event of errors. Adding asserts to catch failing to clear the list of tables to lock. Releasing allocated memory if the table will not be replicated. sql/rpl_rli.h: Adding assert to ensure post-condition of clear_tables_to_lock(). Minor rewrites.
Diffstat (limited to 'sql/rpl_rli.h')
-rw-r--r--sql/rpl_rli.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h
index cacae1aa4c2..99606353080 100644
--- a/sql/rpl_rli.h
+++ b/sql/rpl_rli.h
@@ -309,15 +309,14 @@ typedef struct st_relay_log_info
void cleanup_context(THD *, bool);
void clear_tables_to_lock() {
- TABLE_LIST *ptr= tables_to_lock;
- while (ptr)
+ while (tables_to_lock)
{
- char *to_free= reinterpret_cast<char*>(ptr);
- ptr= ptr->next_global;
+ 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));
}
- tables_to_lock= 0;
- tables_to_lock_count= 0;
+ DBUG_ASSERT(tables_to_lock == NULL && tables_to_lock_count == 0);
}
time_t unsafe_to_stop_at;