summaryrefslogtreecommitdiff
path: root/sql/sql_repl.cc
diff options
context:
space:
mode:
authorunknown <SergeyV@selena.>2005-11-14 18:10:16 +0300
committerunknown <SergeyV@selena.>2005-11-14 18:10:16 +0300
commitd6dc5299a66d9f83c38fe84513a2deb4a9f5fc90 (patch)
tree1496447ebab233692272c3ade3cc50608f9d64e2 /sql/sql_repl.cc
parentf8e19462657c8e68ed3678775d4d81e0aaf2e9d2 (diff)
downloadmariadb-git-d6dc5299a66d9f83c38fe84513a2deb4a9f5fc90.tar.gz
Import patch for bug #13377 from current 5.0 bk tree.mysql-5.0.16
include/my_global.h: Import patch 00.txt include/my_sys.h: Import patch 00.txt mysys/my_create.c: Import patch 00.txt mysys/my_open.c: Import patch 00.txt sql/log.cc: Import patch 00.txt sql/sql_class.h: Import patch 00.txt sql/sql_repl.cc: Import patch 00.txt
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r--sql/sql_repl.cc39
1 files changed, 7 insertions, 32 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index b5865fa8816..cd293fc21c7 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -372,11 +372,6 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos,
goto err;
}
- /*
- Call readers_addref before opening log to track count
- of binlog readers
- */
- mysql_bin_log.readers_addref();
if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0)
{
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
@@ -574,8 +569,7 @@ impossible position";
goto err;
if (!(flags & BINLOG_DUMP_NON_BLOCK) &&
- mysql_bin_log.is_active(log_file_name) &&
- !mysql_bin_log.is_reset_pending())
+ mysql_bin_log.is_active(log_file_name))
{
/*
Block until there is more data in the log
@@ -688,13 +682,7 @@ impossible position";
else
{
bool loop_breaker = 0;
- // need this to break out of the for loop from switch
-
- // if we are going to switch log file anyway, close current log first
- end_io_cache(&log);
- (void) my_close(file, MYF(MY_WME));
- // decrease reference count of binlog readers
- mysql_bin_log.readers_release();
+ /* need this to break out of the for loop from switch */
thd->proc_info = "Finished reading one binlog; switching to next binlog";
switch (mysql_bin_log.find_next_log(&linfo, 1)) {
@@ -704,25 +692,16 @@ impossible position";
case 0:
break;
default:
- // need following call to do release on err label
- mysql_bin_log.readers_addref();
errmsg = "could not find next log";
my_errno= ER_MASTER_FATAL_ERROR_READING_BINLOG;
goto err;
}
- if (loop_breaker)
- {
- // need following call to do release on end label
- mysql_bin_log.readers_addref();
- break;
- }
-
- /*
- Call readers_addref before opening log to track count
- of binlog readers
- */
- mysql_bin_log.readers_addref();
+ if (loop_breaker)
+ break;
+
+ end_io_cache(&log);
+ (void) my_close(file, MYF(MY_WME));
/*
Call fake_rotate_event() in case the previous log (the one which
@@ -755,8 +734,6 @@ end:
end_io_cache(&log);
(void)my_close(file, MYF(MY_WME));
- // decrease reference count of binlog readers
- mysql_bin_log.readers_release();
send_eof(thd);
thd->proc_info = "Waiting to finalize termination";
@@ -783,8 +760,6 @@ err:
pthread_mutex_unlock(&LOCK_thread_count);
if (file >= 0)
(void) my_close(file, MYF(MY_WME));
- // decrease reference count of binlog readers
- mysql_bin_log.readers_release();
my_message(my_errno, errmsg, MYF(0));
DBUG_VOID_RETURN;