mariadb/mysql-test/suite/rpl/t/password_expiration.test
Sergei Golubchik 1e6210161d MDEV-7597 Expiration of user passwords
post-merge changes:
* handle password expiration on old tables like everything else -
  make changes in memory, even if they cannot be done on disk
* merge "debug" tests with non-debug tests, they don't use dbug anyway
* only run rpl password expiration in MIXED mode, it doesn't replicate
  anything, so no need to repeat it thrice
* restore update_user_table_password() prototype, it should not change
  ACL_USER, this is done in acl_user_update()
* don't parse json twice in get_password_lifetime and get_password_expired
* remove LEX_USER::is_changing_password, see if there was any auth instead
* avoid overflow in expiration calculations
* don't initialize Account_options in the constructor, it's bzero-ed later
* don't create ulong sysvars - they're not portable, prefer uint or ulonglong
* misc simplifications
2019-02-21 15:04:03 +01:00

53 lines
1.2 KiB
Text

#
# 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