summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAndrei Elkin <aelkin@mysql.com>2010-02-25 12:39:43 +0200
committerAndrei Elkin <aelkin@mysql.com>2010-02-25 12:39:43 +0200
commit9a29bd543e664e87a923e0e1529223cefc6607f9 (patch)
tree64c3db88d6dbc8eb09d5225cb3405ac7e190506a /sql
parent6f78ef71d485fb3968355941860d012fc17a9c59 (diff)
downloadmariadb-git-9a29bd543e664e87a923e0e1529223cefc6607f9.tar.gz
Bug #51089 SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS'
backporting of bug@30703 to 5.1. The fixes are backed up with a regression test. mysql-test/include/test_fieldsize.inc: waiting to stop is to be actually exclusively for SQL thread. mysql-test/suite/rpl/r/rpl_show_slave_running.result: new results file is added. mysql-test/suite/rpl/t/rpl_show_slave_running.test: regression test for bug#30703 is added. sql/mysqld.cc: refining `show status like slave_running' handler to correspond to one of `show slave status'. sql/slave.cc: A dbug-sync point is added to complement the regression test.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysqld.cc3
-rw-r--r--sql/slave.cc1
2 files changed, 3 insertions, 1 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index a483b9e2381..c4f459d9581 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -7162,7 +7162,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff)
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;
diff --git a/sql/slave.cc b/sql/slave.cc
index 271b3635cf1..a89ac2e682b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2557,6 +2557,7 @@ pthread_handler_t handle_slave_io(void *arg)
connected:
+ DBUG_SYNC_POINT("debug_lock.before_get_running_status_yes", 10);
// TODO: the assignment below should be under mutex (5.0)
mi->slave_running= MYSQL_SLAVE_RUN_CONNECT;
thd->slave_net = &mysql->net;