summaryrefslogtreecommitdiff
path: root/sql/repl_failsafe.cc
diff options
context:
space:
mode:
authorAlfranio Correia <alfranio.correia@sun.com>2009-12-21 06:42:23 +0000
committerAlfranio Correia <alfranio.correia@sun.com>2009-12-21 06:42:23 +0000
commit56ff29a422a133a158b20452d078b33c6e99daf3 (patch)
tree08afd16f5be1b24243120919f8c17a3afbc746e7 /sql/repl_failsafe.cc
parentc5af8813fd5e1dc97eddc94c98afd24c33bccfb2 (diff)
parent03324f6a0a177d5e31f58533ab773970f2b2f747 (diff)
downloadmariadb-git-56ff29a422a133a158b20452d078b33c6e99daf3.tar.gz
merge mysql-5.1-rep+3 --> mysql-5.1-rep+2-delivery1
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r--sql/repl_failsafe.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index 8a8403d1725..d73b59b8af3 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -183,11 +183,18 @@ 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'");
- /*6 is the total length of port and master_id*/
- if (p+6 != p_end)
+ if (p+10 > p_end)
goto err;
si->port= uint2korr(p);
p += 2;
+ /*
+ We need to by pass the bytes used in the fake rpl_recovery_rank
+ variable. It was removed in patch for BUG#13963. But this would
+ make a server with that patch unable to connect to an old master.
+ See: BUG#49259
+ */
+ // si->rpl_recovery_rank= uint4korr(p);
+ p += 4;
if (!(si->master_id= uint4korr(p)))
si->master_id= server_id;
si->thd= thd;