summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/rpl/t/password_expiration.test
blob: 6934500cb4002761eac1b9bf4209798b9170f27f (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
#
# Test a slave connection is properly handled when the replication
# user has an expired password
#

--source include/not_embedded.inc
--source include/have_binlog_format_mixed.inc
--source include/master-slave.inc

--connection slave
--source include/stop_slave.inc

--connection master
create user 'repl_user' password expire;
grant replication slave on *.* to repl_user;
flush privileges;
set global disconnect_on_expired_password=ON;

--connection slave
--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
CHANGE MASTER TO MASTER_USER= 'repl_user';

START SLAVE;
# ER_MUST_CHANGE_PASSWORD_LOGIN
--let $slave_io_errno= 1862
--source include/wait_for_slave_io_error.inc

# restart slave
--source include/stop_slave_sql.inc
RESET SLAVE;

--connection master
# force sandbox mode for repl_user
set global disconnect_on_expired_password=OFF;

--connection slave
START SLAVE;
# ER_MUST_CHANGE_PASSWORD
--let $slave_io_errno= 1820
--source include/wait_for_slave_io_error.inc

--connection master
DROP USER 'repl_user';
set global disconnect_on_expired_password=default;

--connection slave
--source include/stop_slave_sql.inc
eval CHANGE MASTER TO MASTER_USER='$master_user';
RESET SLAVE;

--let $rpl_only_running_threads= 1
--source include/rpl_end.inc