| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test calls CHANGE MASTER in order to check if replication can |
| 4 |
# restart from where SQL thread left, not from where I/O thread left. |
| 5 |
# |
| 6 |
# This file tests the case when master_info is stored in a file. |
| 7 |
# |
| 8 |
# ==== See also ==== |
| 9 |
# |
| 10 |
# rpl_change_master_crash_safe.test |
| 11 |
|
| 12 |
--source include/no_valgrind_without_big.inc |
| 13 |
--source include/not_group_replication_plugin.inc |
| 14 |
--source include/have_binlog_format_mixed.inc |
| 15 |
--let $rpl_privilege_checks_user_grant_option = 1 |
| 16 |
--source include/set_privilege_checks_user_as_system_user.inc |
| 17 |
--source include/master-slave.inc |
| 18 |
--source extra/rpl_tests/rpl_change_master.test |
| 19 |
|
| 20 |
|
| 21 |
# BUG#11758581 - 50801: CHANGE MASTER ACCEPTS BOGUS VARIABLES |
| 22 |
# We want to check if CHANGE MASTER values have newline characters. |
| 23 |
--source include/rpl_reset.inc |
| 24 |
connection slave; |
| 25 |
|
| 26 |
### |
| 27 |
### This should fail with error ER_WRONG_ARGUMENTS due to empty MASTER_HOST |
| 28 |
### value. |
| 29 |
### |
| 30 |
--source include/stop_slave.inc |
| 31 |
--replace_result $MASTER_MYPORT SOURCE_PORT |
| 32 |
--replace_column 2 #### |
| 33 |
--error ER_WRONG_ARGUMENTS |
| 34 |
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='', SOURCE_PORT=$MASTER_MYPORT; |
| 35 |
|
| 36 |
### |
| 37 |
### This should fail with error ER_SYNTAX_ERROR due to newline |
| 38 |
### in string values. |
| 39 |
### |
| 40 |
--replace_result $MASTER_MYPORT SOURCE_PORT |
| 41 |
--replace_column 2 #### |
| 42 |
--error ER_WRONG_VALUE |
| 43 |
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='127.0.0.1\n127.0.0.1', SOURCE_PORT=$MASTER_MYPORT; |
| 44 |
|
| 45 |
--replace_result $MASTER_MYPORT SOURCE_PORT |
| 46 |
--replace_column 2 #### |
| 47 |
--error ER_WRONG_VALUE |
| 48 |
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root\n', SOURCE_HOST='master2.mycompany.com', SOURCE_PORT=$MASTER_MYPORT, SOURCE_USER='replication', SOURCE_PASSWORD='bigs3cret', SOURCE_LOG_FILE='master2-bin.001', SOURCE_LOG_POS=4; |
| 49 |
|
| 50 |
--replace_result $MASTER_MYPORT SOURCE_PORT |
| 51 |
--replace_column 2 #### |
| 52 |
--error ER_WRONG_VALUE |
| 53 |
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='master2.mycompany.com', SOURCE_PORT=$MASTER_MYPORT, SOURCE_USER='repli\ncation', SOURCE_PASSWORD='bigs3cret', SOURCE_LOG_FILE='master2-bin.001', SOURCE_LOG_POS=4; |
| 54 |
|
| 55 |
--replace_result $MASTER_MYPORT SOURCE_PORT |
| 56 |
--replace_column 2 #### |
| 57 |
--error ER_WRONG_VALUE |
| 58 |
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='master2.mycompany.com', SOURCE_PORT=$MASTER_MYPORT, SOURCE_USER='replication', SOURCE_PASSWORD='bigs3cret', SOURCE_LOG_FILE='master2-bin.\n001', SOURCE_LOG_POS=4; |
| 59 |
|
| 60 |
### |
| 61 |
### This should be accepted. |
| 62 |
### |
| 63 |
--replace_result $MASTER_MYPORT SOURCE_PORT |
| 64 |
--replace_column 2 #### |
| 65 |
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='127.0.0.1', SOURCE_PORT=$MASTER_MYPORT; |
| 66 |
|
| 67 |
--source include/start_slave.inc |
| 68 |
--let $status_items= Master_Host |
| 69 |
--source include/show_slave_status.inc |
| 70 |
--source include/rpl_reset.inc |
| 71 |
|
| 72 |
# |
| 73 |
# Bug #11752299 REPLICATION SLAVE TRUNCATES MASTER_PASSWORD > 32 CHARACTERS |
| 74 |
# |
| 75 |
|
| 76 |
--let $passwd=012345678901234567890123456789ab |
| 77 |
--let assert_cond=CHAR_LENGTH("$passwd") = 32 |
| 78 |
--let assert_text=Password length is 32 |
| 79 |
--source include/assert.inc |
| 80 |
|
| 81 |
connection master; |
| 82 |
SET SQL_LOG_BIN=0; |
| 83 |
--eval CREATE USER [email protected] IDENTIFIED BY '$passwd' |
| 84 |
--eval GRANT REPLICATION SLAVE ON *.* TO [email protected] |
| 85 |
SET SQL_LOG_BIN=1; |
| 86 |
|
| 87 |
connection slave; |
| 88 |
--source include/stop_slave.inc |
| 89 |
|
| 90 |
# First, verify that 32 char maximum password works. |
| 91 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='rpl', SOURCE_PASSWORD='$passwd', SOURCE_SSL=1 |
| 92 |
|
| 93 |
--source include/start_slave_io.inc |
| 94 |
|
| 95 |
--let $slave_param= Slave_IO_Running |
| 96 |
--let $slave_param_value= Yes |
| 97 |
--source include/check_slave_param.inc |
| 98 |
|
| 99 |
# Now, prove 1 char oversized password is rejected |
| 100 |
--error ER_CHANGE_SOURCE_PASSWORD_LENGTH |
| 101 |
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='rpl', SOURCE_PASSWORD='x$passwd', SOURCE_SSL=1 |
| 102 |
|
| 103 |
# Cleanup Bug #11752299 |
| 104 |
|
| 105 |
connection master; |
| 106 |
SET SQL_LOG_BIN=0; |
| 107 |
DROP USER [email protected]; |
| 108 |
FLUSH PRIVILEGES; |
| 109 |
SET SQL_LOG_BIN=1; |
| 110 |
|
| 111 |
connection slave; |
| 112 |
--source include/stop_slave_io.inc |
| 113 |
CHANGE REPLICATION SOURCE TO SOURCE_USER = 'root', SOURCE_PASSWORD = '', SOURCE_SSL=0; |
| 114 |
--source include/start_slave.inc |
| 115 |
|
| 116 |
--source include/rpl_end.inc |