diff options
author | unknown <SergeyV@selena.> | 2005-10-27 17:08:45 +0400 |
---|---|---|
committer | unknown <SergeyV@selena.> | 2005-10-27 17:08:45 +0400 |
commit | 6196a746116b4de60414f717eabcc243a7a3beb6 (patch) | |
tree | 4e2786f5dd3d750b308d52f7c7a10cd70579b177 /sql | |
parent | f0cf596ab7ced595928d330d8c2f2b8027a9c71f (diff) | |
parent | 84e2ab8c15e640499a67c280651813cb622e8da5 (diff) | |
download | mariadb-git-6196a746116b4de60414f717eabcc243a7a3beb6.tar.gz |
Merge svlasenko@bk-internal.mysql.com:/home/bk/mysql-5.0
into selena.:H:/MYSQL/src/#13377-mysql-5.0a
Diffstat (limited to 'sql')
-rw-r--r-- | sql/slave.cc | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index f785bdcd4d7..82d9799fec9 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -582,6 +582,20 @@ int purge_relay_logs(RELAY_LOG_INFO* rli, THD *thd, bool just_reset, rli->slave_skip_counter=0; pthread_mutex_lock(&rli->data_lock); + + /* + we close the relay log fd possibly left open by the slave SQL thread, + to be able to delete it; the relay log fd possibly left open by the slave + I/O thread will be closed naturally in reset_logs() by the + close(LOG_CLOSE_TO_BE_OPENED) call + */ + if (rli->cur_log_fd >= 0) + { + end_io_cache(&rli->cache_buf); + my_close(rli->cur_log_fd, MYF(MY_WME)); + rli->cur_log_fd= -1; + } + if (rli->relay_log.reset_logs(thd)) { *errmsg = "Failed during log reset"; @@ -3692,14 +3706,6 @@ err: mi->slave_running = 0; mi->io_thd = 0; - /* Close log file and free buffers */ - if (mi->rli.cur_log_fd >= 0) - { - end_io_cache(&mi->rli.cache_buf); - my_close(mi->rli.cur_log_fd, MYF(MY_WME)); - mi->rli.cur_log_fd= -1; - } - /* Forget the relay log's format */ delete mi->rli.relay_log.description_event_for_queue; mi->rli.relay_log.description_event_for_queue= 0; @@ -3916,14 +3922,6 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ rli->cached_charset_invalidate(); rli->save_temporary_tables = thd->temporary_tables; - /* Close log file and free buffers if it's already open */ - if (rli->cur_log_fd >= 0) - { - end_io_cache(&rli->cache_buf); - my_close(rli->cur_log_fd, MYF(MY_WME)); - rli->cur_log_fd = -1; - } - /* TODO: see if we can do this conditionally in next_event() instead to avoid unneeded position re-init |