summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index f13ff6c9163..e7873b185c5 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -147,11 +147,11 @@ int THD::register_slave(uchar *packet, size_t packet_length)
if (!(si->master_id= uint4korr(p)))
si->master_id= global_system_variables.server_id;
- binlog_dump_thread_count++;
unregister_slave();
mysql_mutex_lock(&LOCK_thd_data);
slave_info= si;
mysql_mutex_unlock(&LOCK_thd_data);
+ binlog_dump_thread_count++;
return 0;
err:
@@ -161,6 +161,16 @@ err:
}
+bool THD::is_binlog_dump_thread()
+{
+ mysql_mutex_lock(&LOCK_thd_data);
+ bool res= slave_info != NULL;
+ mysql_mutex_unlock(&LOCK_thd_data);
+
+ return res;
+}
+
+
static my_bool show_slave_hosts_callback(THD *thd, Protocol *protocol)
{
my_bool res= FALSE;