List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:January 31 2008 9:07am
Subject:Re: bk commit into 5.0 tree (svoj:1.2594) BUG#22989
View as plain text  
Sergey, hello.

The patch is okay to push.

> 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-29 18:05:14+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-29 18:05:13+04:00, svoj@stripped +6 -2
>     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-29 18:05:13 +04:00
> @@ -158,6 +158,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 +167,13 @@ int register_slave(THD* thd, uchar* pack
>  
>    thd->server_id= si->server_id= uint4korr(p);
>    p+= 4;
> +  errmsg= "Failed to register slave: too long 'report-host'";
>    get_object(p,si->host);
> +  errmsg= "Failed to register slave: too long 'report-user'";
>    get_object(p,si->user);
> +  errmsg= "Failed to register slave; too long 'report-password'";
>    get_object(p,si->password);
> +  errmsg= "Wrong parameters to function register_slave";


As we discussed on #engines, passing the errors messages through a new
parameter to the macro should lessen confusion.



>    if (p+10 > p_end)
>      goto err;
>    si->port= uint2korr(p);
> @@ -187,8 +192,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;
>  }

Thanks for this work!

Andrei
Thread
bk commit into 5.0 tree (svoj:1.2594) BUG#22989Sergey Vojtovich29 Jan
  • Re: bk commit into 5.0 tree (svoj:1.2594) BUG#22989Andrei Elkin31 Jan