summaryrefslogtreecommitdiff
path: root/mysql-test/suite/multi_source/reset_slave.test
blob: 108941c0d1addc07df8a8e3a4d54a6c5290ca7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#
# Check RESET SLAVE [name] [ALL] for multi-source replication
#

--source include/not_embedded.inc
--let $rpl_server_count= 0

--connect (slave,127.0.0.1,root,,,$SERVER_MYPORT_3)

--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'master1' to 
master_port=$SERVER_MYPORT_1, 
master_host='127.0.0.1', 
master_user='root';

start slave 'master1';

set default_master_connection = 'master1';
--source include/wait_for_slave_to_start.inc

--connect (master1,127.0.0.1,root,,,$SERVER_MYPORT_1)

--disable_warnings
drop table if exists t1;
--enable_warnings

create table t1 (i int) engine=MyISAM;
insert into t1 values (1),(2);

--save_master_pos 

--connection slave

--sync_with_master 0,'master1'
stop slave 'master1';

--wait_for_slave_to_stop

--let $datadir = `SELECT @@datadir`

--replace_result $SERVER_MYPORT_1 MYPORT_1
show slave 'master1' status;
--list_files $datadir mysqld*

reset slave 'master1';

--replace_result $SERVER_MYPORT_1 MYPORT_1
show slave 'master1' status;
--list_files $datadir mysqld*

reset slave 'master1' all;

--error WARN_NO_MASTER_INFO
show slave 'master1' status;
--list_files $datadir mysqld*

# Cleanup

drop table t1;
--source reset_master_slave.inc
--disconnect slave

--connection master1
drop table t1;
--source reset_master_slave.inc
--disconnect master1