summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
authorunknown <Li-Bing.Song@sun.com>2009-10-20 14:30:15 +0800
committerunknown <Li-Bing.Song@sun.com>2009-10-20 14:30:15 +0800
commit36fd029eff9526e0f09f6cb081cb84cfd5dd3773 (patch)
treef45d87cf5e0635994d2b198001e60d8e04680b34 /sql/repl_failsafe.cc
parent6ae50d8aedbded8dcdc7504d116f25bcd02535ff (diff)
downloadmariadb-git-36fd029eff9526e0f09f6cb081cb84cfd5dd3773.tar.gz
Bug#13963 SHOW SLAVE HOSTS is unreliable
Before the patch, slaves only appear in the output of SHOW SLAVE HOSTS when report-host option is set. If an expected slave does not appear in the list, nobody knows whether the slave does not connect or has started without the "report-host" option. The output also contains a strange field "Rpl_recovery_rank" which has never been implemented and the manual of MySQL5.4 declares that the field has been removed from MySQL5.4. This patch is done with these, According to the manual of MySQL5.4, "Rpl_recovery_rank" is removed. Slaves will register themselves to master no matter if report_host option is set or not. When slaves are registering themselves, their Server_ids, report_host and other information are together sent to master. Sever_ids are never null and is unique in one replication group. Slaves always can be identified with different Server_ids no matter if report_host exists.
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 582348608de..3d375f906ec 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -183,12 +183,11 @@ int register_slave(THD* thd, uchar* packet, uint packet_length)
get_object(p,si->host, "Failed to register slave: too long 'report-host'");
get_object(p,si->user, "Failed to register slave: too long 'report-user'");
get_object(p,si->password, "Failed to register slave; too long 'report-password'");
- if (p+10 > p_end)
+ /*6 is the total length of port and master_id*/
+ if (p+6 != p_end)
goto err;
si->port= uint2korr(p);
p += 2;
- si->rpl_recovery_rank= uint4korr(p);
- p += 4;
if (!(si->master_id= uint4korr(p)))
si->master_id= server_id;
si->thd= thd;
@@ -669,8 +668,6 @@ bool show_slave_hosts(THD* thd)
field_list.push_back(new Item_empty_string("Password",20));
}
field_list.push_back(new Item_return_int("Port", 7, MYSQL_TYPE_LONG));
- field_list.push_back(new Item_return_int("Rpl_recovery_rank", 7,
- MYSQL_TYPE_LONG));
field_list.push_back(new Item_return_int("Master_id", 10,
MYSQL_TYPE_LONG));
@@ -692,7 +689,6 @@ bool show_slave_hosts(THD* thd)
protocol->store(si->password, &my_charset_bin);
}
protocol->store((uint32) si->port);
- protocol->store((uint32) si->rpl_recovery_rank);
protocol->store((uint32) si->master_id);
if (protocol->write())
{