~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# BUG#45214 
 
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.
 
15
#
 
16
 
 
17
source include/master-slave.inc;
 
18
source include/have_debug.inc;
 
19
 
 
20
connection slave;
 
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");
 
24
 
 
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`;
 
27
 
 
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);
 
31
 
 
32
set global debug= 'd,debug_lock.before_get_UNIX_TIMESTAMP';
 
33
source extra/rpl_tests/rpl_get_master_version_and_clock.test; 
 
34
 
 
35
#Test case 2: Try to get the value of the SERVER_ID from master under network disconnection
 
36
connection slave;
 
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);
 
40
 
 
41
set global debug= 'd,debug_lock.before_get_SERVER_ID';
 
42
source extra/rpl_tests/rpl_get_master_version_and_clock.test;
 
43
 
 
44
eval set global debug= '$debug_saved';
 
45
 
 
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.
 
48
connection slave;
 
49
reset master;
 
50
# replicate ourselves
 
51
source include/stop_slave.inc;
 
52
--replace_result $SLAVE_MYPORT SLAVE_PORT
 
53
eval change master to master_port=$SLAVE_MYPORT;
 
54
start slave;
 
55
 
 
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;
 
64
 
 
65
# End of tests