List:Commits« Previous MessageNext Message »
From:Luis Soares Date:November 9 2011 3:04pm
Subject:bzr push into mysql-trunk branch (luis.soares:3463 to 3464) WL#4143
View as plain text  
 3464 Luis Soares	2011-11-09
      WL#4143
      
      Fixing a -Werror on behalf of Alfranio (slave_was_killed= 0).
      
      In addition, deployed an error message when get_password
      fails to retrieve a password when attempting to connect to the
      master and made the function return immediately. Before, there
      could be the case that the slave failed to retrieve the password
      and later assumed that the connection was established, when 
      indeed it was not.

    modified:
      sql/rpl_slave.cc
 3463 Alfranio Correia	2011-11-09
      The test case rewrite_general_log is executed in both embedded and
      non-embedded mode thus causing result mismatches after the WL#4143.
      To fix this, we disable warning messages when "CHANGE MASTER TO"
      is executed.

    modified:
      mysql-test/r/rewrite_general_log.result
      mysql-test/t/rewrite_general_log.test
=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-11-04 16:07:37 +0000
+++ b/sql/rpl_slave.cc	2011-11-09 13:22:47 +0000
@@ -5805,7 +5805,7 @@ static int safe_connect(THD* thd, MYSQL*
 static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi,
                              bool reconnect, bool suppress_warnings)
 {
-  int slave_was_killed;
+  int slave_was_killed= 0;
   int last_errno= -2;                           // impossible error
   ulong err_count=0;
   char llbuff[22];
@@ -5871,8 +5871,16 @@ static int connect_to_master(THD* thd, M
   if (!mi->is_start_user_configured())
     sql_print_warning("%s", ER(ER_INSECURE_CHANGE_MASTER));
 
-  bool error_pwd= mi->get_password(password, &password_size);
-  while (!error_pwd && !(slave_was_killed = io_slave_killed(thd,mi))
+  if (mi->get_password(password, &password_size))
+  {
+    mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR,
+               ER(ER_SLAVE_FATAL_ERROR),
+               "Unable to configure password when attempting to "
+               "connect to the master server. Connection attempt "
+               "terminated.");
+    DBUG_RETURN(1);
+  }
+  while (!(slave_was_killed = io_slave_killed(thd,mi))
          && (reconnect ? mysql_reconnect(mysql) != 0 :
              mysql_real_connect(mysql, mi->host, mi->get_user(),
                                 password, 0, mi->port, 0, client_flag) == 0))

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (luis.soares:3463 to 3464) WL#4143Luis Soares11 Nov