~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to mysql-test/suite/rpl/t/rpl_show_slave_running.test

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 22:33:55 UTC
  • mto: (1.2.1) (37.1.1 lucid-security)
  • mto: This revision was merged to the branch mainline in revision 36.
  • Revision ID: package-import@ubuntu.com-20120222223355-ku1tb4r70osci6v2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
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
 
5
#
 
6
source include/master-slave.inc;
 
7
source include/have_debug.inc;
 
8
source include/have_debug_sync.inc;
 
9
 
 
10
connection slave;
 
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
 
15
 
 
16
 
 
17
# Test 1. Slave is stopped
 
18
 
 
19
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running, must be OFF, NO, NO in three following queries
 
20
 
 
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;
 
26
 
 
27
# Test 2. The slave IO thread is started but not yet got connected to master
 
28
#         and SQL thread is not started
 
29
 
 
30
start slave io_thread;
 
31
 
 
32
#
 
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
 
37
#
 
38
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF NO NO in three following queries
 
39
 
 
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;
 
45
 
 
46
# Test 3. The slave IO thread is started and got connected to master
 
47
#         and SQL thread is still not started
 
48
 
 
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;
 
53
 
 
54
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be OFF YES NO in three following queries
 
55
 
 
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;
 
61
 
 
62
# Test 4. The slave IO thread is started and got connected to master
 
63
#         and SQL thread is started
 
64
 
 
65
start slave sql_thread;
 
66
source include/wait_for_slave_sql_to_start.inc;
 
67
 
 
68
--echo Slave_running, Slave_IO_Running, Slave_SQL_Running must be ON, YES, YES in three following queries
 
69
 
 
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;
 
75
 
 
76
# cleanup
 
77
 
 
78
connection slave;
 
79
 
 
80
eval set global debug= '$debug_saved';
 
81
SET DEBUG_SYNC= 'RESET';
 
82
--echo End of tests
 
83
--source include/rpl_end.inc