3 # Verify that a slave without replication privileges has
4 # Slave_IO_Running = No
8 # We do the following steps:
9 # - Create a new replication user on master
10 # - Connect to slave and start replication as this user.
11 # - Verify that slave can replicate well, by creating a table and
12 # inserting a row into it.
13 # - Delete the user from the master.
14 # - Stop and start the slave (this should fail).
15 # - Check the Slave_IO_Running column of SHOW SLAVE STATUS.
17 # ==== Related bugs ====
19 # BUG#10780: slave can't connect to master - IO and SQL threads running
21 --source include/master-slave.inc
23 --echo ==== Create new replication user ====
26 GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
29 sync_slave_with_master;
30 source include/stop_slave.inc;
31 CHANGE MASTER TO master_user='rpl', master_password='rpl';
32 source include/start_slave.inc;
34 --echo ==== Do replication as new user ====
37 CREATE TABLE t1 (n INT);
38 INSERT INTO t1 VALUES (1);
40 sync_slave_with_master;
43 --echo ==== Delete new replication user ====
46 DROP USER rpl@127.0.0.1;
50 sync_slave_with_master;
52 --echo ==== Restart slave without privileges =====
53 # (slave.err will contain access denied error for this START SLAVE command)
54 source include/stop_slave.inc;
56 source include/wait_for_slave_sql_to_start.inc;
58 --echo ==== Verify that Slave IO thread stopped with error ====
59 # 1045 = ER_ACCESS_DENIED_ERROR
60 --let $slave_io_errno= 1045
61 --source include/wait_for_slave_io_error.inc
63 --echo ==== Cleanup (Note that slave IO thread is not running) ====
65 # cleanup: slave io thread has is stopped so we reset replication
66 --let $rpl_only_running_threads= 1
67 --source include/rpl_reset.inc
73 --let $rpl_only_running_threads= 1
74 --source include/rpl_end.inc