| 1 |
# |
| 2 |
# This test validates a fix for a bug where slaves only read the |
| 3 |
# first 41 characters of MASTER_PASSWORD from the master.info file |
| 4 |
# after restarts. |
| 5 |
# |
| 6 |
# The test ensures that passwords up to the maximum allowable |
| 7 |
# length (96 ASCII characters) will be read from the master.info |
| 8 |
# file after slave restarts |
| 9 |
# |
| 10 |
# References: |
| 11 |
# MDEV-23857: replication master password length |
| 12 |
# |
| 13 |
|
| 14 |
# Test is format independent, so only run with one format |
| 15 |
--source include/have_binlog_format_mixed.inc |
| 16 |
--source include/master-slave.inc |
| 17 |
|
| 18 |
|
| 19 |
##### |
| 20 |
# Setup |
| 21 |
# |
| 22 |
--let $passwd=123456789X12141618202224262830323436384042444648505254565860626466687072747678808284868890929496 |
| 23 |
--let $expected_pwlen=96 |
| 24 |
--let assert_cond=CHAR_LENGTH("$passwd")=$expected_pwlen |
| 25 |
--let assert_text=Password length is $expected_pwlen |
| 26 |
--source include/assert.inc |
| 27 |
|
| 28 |
connection master; |
| 29 |
SET SQL_LOG_BIN=0; |
| 30 |
--eval GRANT REPLICATION SLAVE ON *.* TO [email protected] IDENTIFIED BY '$passwd' |
| 31 |
SET SQL_LOG_BIN=1; |
| 32 |
##### |
| 33 |
|
| 34 |
|
| 35 |
##### |
| 36 |
# Change master to new user/password combination |
| 37 |
# |
| 38 |
connection slave; |
| 39 |
--source include/stop_slave.inc |
| 40 |
--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', master_user='rpl', master_password='$passwd' |
| 41 |
|
| 42 |
--source include/start_slave.inc |
| 43 |
--let $slave_param= Slave_IO_Running |
| 44 |
--let $slave_param_value= Yes |
| 45 |
--source include/check_slave_param.inc |
| 46 |
##### |
| 47 |
|
| 48 |
|
| 49 |
##### |
| 50 |
# Ensure slave can re-connect to master after restart |
| 51 |
# |
| 52 |
connection master; |
| 53 |
--let $rpl_server_number= 2 |
| 54 |
--source include/rpl_restart_server.inc |
| 55 |
|
| 56 |
connection slave; |
| 57 |
--source include/start_slave.inc |
| 58 |
--let $slave_param= Slave_IO_Running |
| 59 |
--let $slave_param_value= Yes |
| 60 |
--source include/check_slave_param.inc |
| 61 |
##### |
| 62 |
|
| 63 |
|
| 64 |
##### |
| 65 |
# Cleanup |
| 66 |
# |
| 67 |
connection master; |
| 68 |
SET SQL_LOG_BIN=0; |
| 69 |
DROP USER [email protected]; |
| 70 |
FLUSH PRIVILEGES; |
| 71 |
SET SQL_LOG_BIN=1; |
| 72 |
|
| 73 |
connection slave; |
| 74 |
--source include/stop_slave.inc |
| 75 |
CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = ''; |
| 76 |
--source include/start_slave.inc |
| 77 |
|
| 78 |
connection master; |
| 79 |
-- source include/rpl_end.inc |
| 80 |
##### |