diff --git a/sql/log.cc b/sql/log.cc index 1e4682e4bc3..1625346f59f 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -5284,11 +5284,10 @@ int MYSQL_BIN_LOG::wait_for_update_bin_log(THD* thd, const struct timespec *timeout) { int ret= 0; - const char* old_msg = thd->proc_info; DBUG_ENTER("wait_for_update_bin_log"); - old_msg= thd->enter_cond(&update_cond, &LOCK_log, - "Master has sent all binlog to slave; " - "waiting for binlog to be updated"); + thd->enter_cond(&update_cond, &LOCK_log, + "Master has sent all binlog to slave; " + "waiting for binlog to be updated"); if (!timeout) mysql_cond_wait(&update_cond, &LOCK_log); else diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index ab6c6e738b2..413e15bf1fe 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -826,6 +826,7 @@ impossible position"; #ifndef DBUG_OFF ulong hb_info_counter= 0; #endif + const char* old_msg= thd->proc_info; signal_cnt= mysql_bin_log.signal_cnt; do { @@ -849,12 +850,15 @@ impossible position"; #endif /* reset transmit packet for the heartbeat event */ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg)) + { + thd->exit_cond(old_msg); goto err; + } if (send_heartbeat_event(net, packet, coord)) { errmsg = "Failed on my_net_write()"; my_errno= ER_UNKNOWN_ERROR; - mysql_mutex_unlock(log_lock); + thd->exit_cond(old_msg); goto err; } } @@ -863,7 +867,7 @@ impossible position"; DBUG_PRINT("wait",("binary log received update or a broadcast signal caught")); } } while (signal_cnt == mysql_bin_log.signal_cnt && !thd->killed); - mysql_mutex_unlock(log_lock); + thd->exit_cond(old_msg); } break;