~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
--source include/master-slave.inc
2
3
############################################################################
4
# Test case for BUG#10780
5
#
6
# REQUIREMENT
7
#   A slave without replication privileges should have Slave_IO_Running = No
8
9
# 1. Create new replication user
10
connection master;
11
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
12
flush privileges;
13
sync_slave_with_master;
14
15
stop slave;
16
change master to master_user='rpl',master_password='rpl';
17
start slave;
18
19
# 2. Do replication as new user
20
connection master;
21
--disable_warnings
22
drop table if exists t1;
23
--enable_warnings
24
create table t1 (n int);
25
insert into t1 values (1);
26
save_master_pos;
27
connection slave;
28
sync_with_master;
29
select * from t1;
30
31
# 3. Delete new replication user
32
# note: drop user will be replicated on slave
33
connection master;
34
drop user rpl@127.0.0.1;
35
flush privileges;
36
sync_slave_with_master;
37
38
# 4. Restart slave without privileges
39
# (slave.err will contain access denied error for this START SLAVE command)
40
stop slave;
41
start slave;
42
43
# 5. Make sure Slave_IO_Running = No
44
--replace_result $MASTER_MYPORT MASTER_MYPORT
45
# Column 1 is replaced, since the output can be either
46
# "Connecting to master" or "Waiting for master update"
47
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 #
48
--vertical_results
49
show slave status;
50
51
# Cleanup (Note that slave IO thread is not running)
52
connection slave;
53
drop table t1;
54
# cleanup: slave io thread has been stopped "irrecoverably"
55
# so we clean up mess manually
56
57
connection master;
58
drop table t1;
59
60
# end of 4.1 tests