diff options
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc index 58f5298dad0..01bd08956fb 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -97,8 +97,15 @@ MYSQL_LOG::MYSQL_LOG() MYSQL_LOG::~MYSQL_LOG() { + cleanup(); +} + +void MYSQL_LOG::cleanup() +{ if (inited) { + close(1); + inited= 0; (void) pthread_mutex_destroy(&LOCK_log); (void) pthread_mutex_destroy(&LOCK_index); (void) pthread_cond_destroy(&update_cond); @@ -1430,6 +1437,10 @@ void MYSQL_LOG:: wait_for_update(THD* thd) at once after close, in which case we don't want to close the index file. We only write a 'stop' event to the log if exiting is set + + NOTES + One can do an open on the object at once after doing a close. + The internal structures are not freed until cleanup() is called */ void MYSQL_LOG::close(bool exiting) |