3
# This test verifies if the slave I/O tread tries to reconnect to
4
# master when it tries to get the values of the UNIX_TIMESTAMP, SERVER_ID,
5
# COLLATION_SERVER and TIME_ZONE from master under network disconnection.
6
# The COLLATION_SERVER and TIME_ZONE are got only on master server version 4.
7
# So they can't be verified by test case here.
8
# Finish the following tests by calling its common test script:
9
# extra/rpl_tests/rpl_get_master_version_and_clock.test.
10
# And meanwhile this test checks that the slave I/O thread refuses to start if slave
11
# and master have the same server id (because this is a useless setup,
12
# and otherwise SHOW SLAVE STATUS shows progress but all queries are
13
# ignored, which has caught our customers), unless
14
# --replicate-same-server-id.
17
source include/master-slave.inc;
18
source include/have_debug.inc;
21
call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
22
call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
23
call mtr.add_suppression("Slave I/O thread .* register on master");
25
#Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
26
let $debug_saved= `select @@global.debug`;
28
let $debug_lock= "debug_lock.before_get_UNIX_TIMESTAMP";
29
eval SELECT IS_FREE_LOCK($debug_lock);
30
eval SELECT GET_LOCK($debug_lock, 1000);
32
set global debug= 'd,debug_lock.before_get_UNIX_TIMESTAMP';
33
source extra/rpl_tests/rpl_get_master_version_and_clock.test;
35
#Test case 2: Try to get the value of the SERVER_ID from master under network disconnection
37
let $debug_lock= "debug_lock.before_get_SERVER_ID";
38
eval SELECT IS_FREE_LOCK($debug_lock);
39
eval SELECT GET_LOCK($debug_lock, 1000);
41
set global debug= 'd,debug_lock.before_get_SERVER_ID';
42
source extra/rpl_tests/rpl_get_master_version_and_clock.test;
44
eval set global debug= '$debug_saved';
46
#Test case 3: This test checks that the slave I/O thread refuses to start
47
#if slave and master have the same server id.
51
source include/stop_slave.inc;
52
--replace_result $SLAVE_MYPORT SLAVE_PORT
53
eval change master to master_port=$SLAVE_MYPORT;
56
let $slave_param= Last_IO_Errno;
57
let $slave_param_value= 1593;
58
source include/wait_for_slave_param.inc;
59
--echo *** must be having the replicate-same-server-id IO thread error ***
60
let $last_io_errno= query_get_value("show slave status", Last_IO_Errno, 1);
61
let $last_io_error= query_get_value("show slave status", Last_IO_Error, 1);
62
echo Slave_IO_Errno= $last_io_errno;
63
echo Slave_IO_Error= $last_io_error;