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

« back to all changes in this revision

Viewing changes to mysql-test/extra/rpl_tests/rpl_reset_slave.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
# TBF - difference in row level logging
 
2
# Temp tables are not replicated in rbr, but it is still good to hit rbr with everthing
 
3
 
 
4
# See SHOW SLAVE STATUS displays well after RESET SLAVE (it should display the
 
5
# --master-* options from mysqld, as this is what is going to be used next time
 
6
# slave threads will be started). In bug 985, it displayed old values (of before
 
7
# RESET SLAVE).
 
8
# See if slave crashes when doing a CREATE TEMPORARY TABLE twice, separated by
 
9
# RESET SLAVE.
 
10
 
 
11
-- source include/master-slave.inc
 
12
connection master;
 
13
save_master_pos;
 
14
connection slave;
 
15
sync_with_master;
 
16
source include/show_slave_status2.inc;
 
17
 
 
18
stop slave;
 
19
change master to master_user='test';
 
20
source include/show_slave_status2.inc;
 
21
 
 
22
reset slave;
 
23
source include/show_slave_status2.inc;
 
24
 
 
25
start slave;
 
26
sync_with_master;
 
27
source include/show_slave_status2.inc;
 
28
 
 
29
# test of crash with temp tables & RESET SLAVE
 
30
# (test to see if RESET SLAVE clears temp tables in memory and disk)
 
31
stop slave;
 
32
reset slave;
 
33
start slave;
 
34
connection master;
 
35
create temporary table t1 (a int);
 
36
save_master_pos;
 
37
connection slave;
 
38
sync_with_master;
 
39
stop slave;
 
40
reset slave;
 
41
start slave;
 
42
sync_with_master;
 
43
show status like 'slave_open_temp_tables';
 
44
 
 
45
#
 
46
#Bug#34654      RESET SLAVE does not clear LAST_IO_Err* 
 
47
#
 
48
 
 
49
# clearing the status
 
50
stop slave;
 
51
reset slave;
 
52
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
 
53
echo *** errno must be zero: $last_io_errno ***;
 
54
 
 
55
#
 
56
# verifying start slave resets Last_IO_Error and Last_IO_Errno.
 
57
#
 
58
 
 
59
change master to master_user='impossible_user_name';
 
60
start slave;
 
61
source include/wait_for_slave_io_error.inc;
 
62
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
 
63
--disable_query_log
 
64
eval SELECT $last_io_errno > 0 as ONE;
 
65
--enable_query_log
 
66
 
 
67
source include/stop_slave.inc;
 
68
change master to master_user='root';
 
69
source include/start_slave.inc;
 
70
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
 
71
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
 
72
--echo *** last errno must be  zero: $last_io_errno ***
 
73
--echo *** last error must be blank: $last_io_error ***
 
74
 
 
75
#
 
76
# verifying reset slave resets Last_{IO,SQL}_Err{or,no}
 
77
#
 
78
 
 
79
source include/stop_slave.inc;
 
80
change master to master_user='impossible_user_name';
 
81
start slave;
 
82
source include/wait_for_slave_io_error.inc;
 
83
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
 
84
--disable_query_log
 
85
eval SELECT $last_io_errno > 0 as ONE;
 
86
--enable_query_log
 
87
 
 
88
source include/stop_slave.inc;
 
89
reset slave;
 
90
let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
 
91
let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
 
92
let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
 
93
let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
 
94
--echo *** io  last errno must be  zero: $last_io_errno  ***
 
95
--echo *** io  last error must be blank: $last_io_error  ***
 
96
--echo *** sql last errno must be  zero: $last_sql_errno ***
 
97
--echo *** sql last error must be blank: $last_sql_error ***