List:Commits« Previous MessageNext Message »
From:Luis Soares Date:September 29 2009 2:10pm
Subject:bzr commit into mysql-5.1-rep+2 branch (luis.soares:3116) Bug#30703
View as plain text  
#At file:///home/lsoares/Workspace/bzr/work/backport/mysql-5.1-rep%2B2-to-push/ based on revid:luis.soares@stripped

 3116 Luis Soares	2009-09-29
      Bug #30703  SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE
      STATUS'
            
      NOTE: this is the backport to next-mr.
                  
      SHOW SHOW STATUS LIKE 'Slave_running' command believes that
      if active_mi->slave_running != 0, then io thread is running normally.
      But it isn't so in fact. When some errors happen to make io thread
      try to reconnect master, then it will become transitional status
      (MYSQL_SLAVE_RUN_NOT_CONNECT == 1), which also doesn't equal 0.
      Yet, "SHOW SLAVE STATUS" believes that only if
      active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT, then io thread is running.
      So "SHOW SLAVE STATUS" can get the correct result.
                  
                  
      Fixed to make SHOW SHOW STATUS LIKE 'Slave_running' command have the same
      check condition with "SHOW SLAVE STATUS". It only believe that the io thread
      is running when active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT.

    modified:
      mysql-test/include/test_fieldsize.inc
      sql/mysqld.cc
=== modified file 'mysql-test/include/test_fieldsize.inc'
--- a/mysql-test/include/test_fieldsize.inc	2007-08-10 16:48:01 +0000
+++ b/mysql-test/include/test_fieldsize.inc	2009-09-29 14:10:37 +0000
@@ -22,7 +22,7 @@ eval $test_insert;
 
 connection slave;
 START SLAVE;
-wait_for_slave_to_stop;
+--source include/wait_for_slave_sql_to_stop.inc
 --replace_result $MASTER_MYPORT MASTER_PORT
 --replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
 --query_vertical SHOW SLAVE STATUS

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2009-09-28 23:04:20 +0000
+++ b/sql/mysqld.cc	2009-09-29 14:10:37 +0000
@@ -7043,7 +7043,8 @@ static int show_slave_running(THD *thd, 
   var->type= SHOW_MY_BOOL;
   pthread_mutex_lock(&LOCK_active_mi);
   var->value= buff;
-  *((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running &&
+  *((my_bool *)buff)= (my_bool) (active_mi && 
+                                 active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT &&
                                  active_mi->rli.slave_running);
   pthread_mutex_unlock(&LOCK_active_mi);
   return 0;


Attachment: [text/bzr-bundle] bzr/luis.soares@sun.com-20090929141037-ahjv83hhsnzqrglr.bundle
Thread
bzr commit into mysql-5.1-rep+2 branch (luis.soares:3116) Bug#30703Luis Soares29 Sep