2
# Bug #30703 SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS'
3
# The test verifies that SHOW STATUS LIKE 'Slave_running' displays ON
4
# if and only if `SHOW SLAVE STATUS' displays YES for Slave_IO_Running and Slave_SQL_Running
6
source include/master-slave.inc;
7
source include/have_debug.inc;
8
source include/have_debug_sync.inc;
11
SET DEBUG_SYNC= 'RESET';
12
source include/stop_slave.inc;
13
let $debug_saved= `select @@global.debug`;
14
set global debug= 'd,dbug.before_get_running_status_yes'; # to block due-started IO
17
# Test 1. Slave is stopped
19
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
21
SHOW STATUS LIKE 'Slave_running';
22
let $status= query_get_value("show slave status", Slave_IO_Running, 1);
23
echo Slave_IO_Running= $status;
24
let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
25
echo Slave_SQL_Running= $status;
27
# Test 2. The slave IO thread is started but not yet got connected to master
28
# and SQL thread is not started
30
start slave io_thread;
33
# Notice a difference between versions in showing p.2:
34
# 5.1 has two OFF,ON IO-thread state running state whereas later versions
35
# have three: OFF,Connecting,ON.
36
# Hence, 5.1 must display OFF NO NO where as 5.1+ OFF Connecting NO
38
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF NO NO in three following queries
40
SHOW STATUS LIKE 'Slave_running';
41
let $status= query_get_value("show slave status", Slave_IO_Running, 1);
42
echo Slave_IO_Running= $status;
43
let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
44
echo Slave_SQL_Running= $status;
46
# Test 3. The slave IO thread is started and got connected to master
47
# and SQL thread is still not started
49
SET DEBUG_SYNC='now SIGNAL signal.io_thread_let_running'; # unblock IO thread now
50
let $slave_param= Slave_IO_Running;
51
let $slave_param_value= YES;
52
source include/wait_for_slave_param.inc;
54
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
56
SHOW STATUS LIKE 'Slave_running';
57
let $status= query_get_value("show slave status", Slave_IO_Running, 1);
58
echo Slave_IO_Running= $status;
59
let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
60
echo Slave_SQL_Running= $status;
62
# Test 4. The slave IO thread is started and got connected to master
63
# and SQL thread is started
65
start slave sql_thread;
66
source include/wait_for_slave_sql_to_start.inc;
68
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
70
SHOW STATUS LIKE 'Slave_running';
71
let $status= query_get_value("show slave status", Slave_IO_Running, 1);
72
echo Slave_IO_Running= $status;
73
let $status= query_get_value("show slave status", Slave_SQL_Running, 1);
74
echo Slave_SQL_Running= $status;
80
eval set global debug= '$debug_saved';
81
SET DEBUG_SYNC= 'RESET';
83
--source include/rpl_end.inc