MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:January 31 2008 3:06pm
Subject:bk commit into 5.0 tree (svoj:1.2569) BUG#22989
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of svoj.  When svoj does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-01-31 18:51:20+04:00, svoj@stripped +1 -0
  BUG#22989 - START SLAVE causes Error on COM_REGISTER_SLAVE: 1105
              'Wrong parameters to functi
  
  START SLAVE reports vague error when it fails to register on master:
  "Wrong parameters to function register_slave".
  
  If master failed to register slave because of too long
  'report-host'/'report-user'/'report-password', return better error
  messages:
  "Failed to register slave: too long 'report-host'"
  "Failed to register slave: too long 'report-user'"
  "Failed to register slave; too long 'report-password'"
  
  No test case for this fix.

  sql/repl_failsafe.cc@stripped, 2008-01-31 18:51:18+04:00, svoj@stripped +9 -6
    Report descriptive error when master fails to register slave.

diff -Nrup a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
--- a/sql/repl_failsafe.cc	2007-11-26 11:52:48 +04:00
+++ b/sql/repl_failsafe.cc	2008-01-31 18:51:18 +04:00
@@ -109,11 +109,14 @@ void change_rpl_status(RPL_STATUS from_s
 }
 
 
-#define get_object(p, obj) \
+#define get_object(p, obj, msg) \
 {\
   uint len = (uint)*p++;  \
   if (p + len > p_end || len >= sizeof(obj)) \
+  {\
+    errmsg= msg;\
     goto err; \
+  }\
   strmake(obj,(char*) p,len); \
   p+= len; \
 }\
@@ -158,6 +161,7 @@ int register_slave(THD* thd, uchar* pack
   int res;
   SLAVE_INFO *si;
   uchar *p= packet, *p_end= packet + packet_length;
+  const char *errmsg= "Wrong parameters to function register_slave";
 
   if (check_access(thd, REPL_SLAVE_ACL, any_db,0,0,0,0))
     return 1;
@@ -166,9 +170,9 @@ int register_slave(THD* thd, uchar* pack
 
   thd->server_id= si->server_id= uint4korr(p);
   p+= 4;
-  get_object(p,si->host);
-  get_object(p,si->user);
-  get_object(p,si->password);
+  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)
     goto err;
   si->port= uint2korr(p);
@@ -187,8 +191,7 @@ int register_slave(THD* thd, uchar* pack
 
 err:
   my_free((gptr) si, MYF(MY_WME));
-  my_message(ER_UNKNOWN_ERROR, "Wrong parameters to function register_slave",
-	     MYF(0));
+  my_message(ER_UNKNOWN_ERROR, errmsg, MYF(0));
 err2:
   return 1;
 }
Thread
bk commit into 5.0 tree (svoj:1.2569) BUG#22989Sergey Vojtovich31 Jan