File: rpl_change_master.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (116 lines) | stat: -rw-r--r-- 4,072 bytes parent folder | download
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# ==== Purpose ====
#
# This test calls CHANGE MASTER in order to check if replication can
# restart from where SQL thread left, not from where I/O thread left.
#
# This file tests the case when master_info is stored in a file.
#
# ==== See also ====
#
# rpl_change_master_crash_safe.test

--source include/no_valgrind_without_big.inc
--source include/not_group_replication_plugin.inc
--source include/have_binlog_format_mixed.inc
--let $rpl_privilege_checks_user_grant_option = 1
--source include/set_privilege_checks_user_as_system_user.inc
--source include/master-slave.inc
--source extra/rpl_tests/rpl_change_master.test


# BUG#11758581 - 50801: CHANGE MASTER ACCEPTS BOGUS VARIABLES
# We want to check if CHANGE MASTER values have newline characters.
--source include/rpl_reset.inc
connection slave;

###
### This should fail with error ER_WRONG_ARGUMENTS due to empty MASTER_HOST
### value.
###
--source include/stop_slave.inc
--replace_result $MASTER_MYPORT SOURCE_PORT
--replace_column 2 ####
--error ER_WRONG_ARGUMENTS
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='', SOURCE_PORT=$MASTER_MYPORT;

###
### This should fail with error ER_SYNTAX_ERROR due to newline
### in string values.
###
--replace_result $MASTER_MYPORT SOURCE_PORT
--replace_column 2 ####
--error ER_WRONG_VALUE
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='127.0.0.1\n127.0.0.1', SOURCE_PORT=$MASTER_MYPORT;

--replace_result $MASTER_MYPORT SOURCE_PORT
--replace_column 2 ####
--error ER_WRONG_VALUE
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;

--replace_result $MASTER_MYPORT SOURCE_PORT
--replace_column 2 ####
--error ER_WRONG_VALUE
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;

--replace_result $MASTER_MYPORT SOURCE_PORT
--replace_column 2 ####
--error ER_WRONG_VALUE
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;

###
### This should be accepted.
###
--replace_result $MASTER_MYPORT SOURCE_PORT
--replace_column 2 ####
eval CHANGE REPLICATION SOURCE TO SOURCE_USER='root', SOURCE_HOST='127.0.0.1', SOURCE_PORT=$MASTER_MYPORT;

--source include/start_slave.inc
--let $status_items= Master_Host
--source include/show_slave_status.inc
--source include/rpl_reset.inc

#
# Bug #11752299 REPLICATION SLAVE TRUNCATES MASTER_PASSWORD > 32 CHARACTERS
#

--let $passwd=012345678901234567890123456789ab
--let assert_cond=CHAR_LENGTH("$passwd") = 32
--let assert_text=Password length is 32
--source include/assert.inc

connection master;
SET SQL_LOG_BIN=0;
--eval CREATE USER rpl@127.0.0.1 IDENTIFIED BY '$passwd'
--eval GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1
SET SQL_LOG_BIN=1;

connection slave;
--source include/stop_slave.inc

# First, verify that 32 char maximum password works.
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='rpl', SOURCE_PASSWORD='$passwd', SOURCE_SSL=1

--source include/start_slave_io.inc

--let $slave_param= Slave_IO_Running
--let $slave_param_value= Yes
--source include/check_slave_param.inc

# Now, prove 1 char oversized password is rejected
--error ER_CHANGE_SOURCE_PASSWORD_LENGTH
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1', SOURCE_USER='rpl', SOURCE_PASSWORD='x$passwd', SOURCE_SSL=1

# Cleanup Bug #11752299

connection master;
SET SQL_LOG_BIN=0;
DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES;
SET SQL_LOG_BIN=1;

connection slave;
--source include/stop_slave_io.inc
CHANGE REPLICATION SOURCE TO SOURCE_USER = 'root', SOURCE_PASSWORD = '', SOURCE_SSL=0;
--source include/start_slave.inc

--source include/rpl_end.inc