File: rpl_replica_terminology.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 (220 lines) | stat: -rw-r--r-- 9,097 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
--let $rpl_skip_start_slave=1
--source include/master-slave.inc
--source include/have_binlog_format_row.inc

# Add data on source
CREATE TABLE t1(a INT PRIMARY KEY);
DROP TABLE t1;

--let $source_pos=query_get_value('SHOW BINARY LOGS','File_size',1)
--let $source_file=query_get_value('SHOW BINARY LOGS','Log_name',1)

--source include/rpl_connection_slave.inc

# Execute START REPLICA with MASTER_LOG_FILE and MASTER_LOG_POS param
--replace_result $source_file source_file $source_pos source_pos
--eval START REPLICA UNTIL MASTER_LOG_FILE='$source_file',MASTER_LOG_POS=$source_pos

# Check Until_Condition value is 'Source' in the output of
# SHOW REPLICA STATUS
--let $replica_until_cond=query_get_value('SHOW REPLICA STATUS','Until_Condition',1)
--let $assert_cond= "$replica_until_cond" = "Source"
--let $assert_text= Until condition is 'source' on replica
--source include/assert.inc

--source include/wait_for_slave_sql_to_stop.inc
# Start replication to continue
--source include/start_slave.inc

#
# SHOW REPLICAS
#

--source include/rpl_connection_master.inc

# first assert that the fields are in the result set with the expected
# name (old and new names). Do not record in the result file, since
# the output is not deterministic

--let $dontcare = query_get_value(SHOW SLAVE HOSTS, Slave_UUID, 1)
--let $dontcare = query_get_value(SHOW SLAVE HOSTS, Master_id, 1)

# new syntax and assert that the new names of the fields are
# the ones used

--let $dontcare = query_get_value(SHOW REPLICAS, Replica_UUID, 1)
--let $dontcare = query_get_value(SHOW REPLICAS, Source_Id, 1)

--disable_result_log
# emits a deprecation warning
SHOW SLAVE HOSTS;
--enable_result_log
SHOW WARNINGS;
--disable_result_log
# does not emit a warning
SHOW REPLICAS;
--enable_result_log
SHOW WARNINGS;

#
# SHOW REPLICA STATUS
#

--source include/rpl_connection_slave.inc

# first assert that the fields are in the result set with the expected
# name (old and new names). Do not record in the result file, since
# the output is not deterministic

--let $dontcare = query_get_value(SHOW SLAVE STATUS, Slave_IO_State, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_User, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Port, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Relay_Master_Log_File, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Exec_Master_Log_Pos, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Allowed, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_CA_File, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_CA_Path, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Cert, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Cipher, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Key, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Verify_Server_Cert, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Info_File, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running_State, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Retry_Count, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_Bind, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Crl, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_SSL_Crlpath, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_TLS_Version, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Master_public_key_path, 1)
--let $dontcare = query_get_value(SHOW SLAVE STATUS, Get_master_public_key, 1)

# new syntax and  assert that the new names of the fields are
# the ones used

--let $dontcare = query_get_value(SHOW REPLICA STATUS, Replica_IO_State, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Host, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_User, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Port, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Log_File, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Read_Source_Log_Pos, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Relay_Source_Log_File, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Replica_IO_Running, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Replica_SQL_Running, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Exec_Source_Log_Pos, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Allowed, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_CA_File, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_CA_Path, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Cert, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Cipher, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Key, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Seconds_Behind_Source, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Verify_Server_Cert, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Server_Id, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_UUID, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Info_File, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Replica_SQL_Running_State, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Retry_Count, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_Bind, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Crl, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_SSL_Crlpath, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_TLS_Version, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Source_public_key_path, 1)
--let $dontcare = query_get_value(SHOW REPLICA STATUS, Get_Source_public_key, 1)

# Now check for the deprecation warning and record it in the result file.
# We output a single deterministic field to make the test case resilient.

--disable_result_log
# emits a deprecation warning
SHOW SLAVE STATUS;
--enable_result_log
SHOW WARNINGS;
--disable_result_log
# does not emit a deprecation warning
SHOW REPLICA STATUS;
--enable_result_log
SHOW WARNINGS;

#
# RESET REPLICA
#

--source include/stop_slave.inc

# must emit a deprecation warning
RESET SLAVE;

# must not emit a deprecation warning
RESET REPLICA;

# must emit a deprecation warning
START SLAVE;
--source include/wait_for_slave_to_start.inc

# must emit a deprecation warning
STOP SLAVE;
--source include/wait_for_slave_to_stop.inc

# must not emit a deprecation warning
START REPLICA;
--source include/wait_for_slave_to_start.inc

# must not emit a deprecation warning
STOP REPLICA;
--source include/wait_for_slave_to_stop.inc

# must emit a deprecation warning
RESET SLAVE ALL;

# must not emit a deprecation warning
RESET REPLICA ALL;

--replace_result $MASTER_MYPORT MASTER_PORT
--eval CHANGE REPLICATION SOURCE TO SOURCE_HOST='127.0.0.1',SOURCE_PORT=$MASTER_MYPORT,SOURCE_USER='root' for CHANNEL ''

### START REPLICA UNTIL SOURCE_LOG_FILE and SOURCE_LOG_POS

--source include/rpl_connection_master.inc
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1);
--let $log_file= query_get_value(SHOW MASTER STATUS, File, 1)
--let $log_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
--source include/rpl_connection_slave.inc
# Once deprecation warnings are introduced, this statement shall
# continue to not produce any warnings
--replace_result $log_file LOG_FILE $log_pos LOG_POS
--eval START REPLICA UNTIL SOURCE_LOG_FILE='$log_file', SOURCE_LOG_POS=$log_pos
--source include/wait_for_slave_sql_to_stop.inc
--source include/stop_slave.inc
--let $diff_tables=master:t1,slave:t1
--source include/diff_tables.inc
DROP TABLE t1;
RESET REPLICA;
RESET MASTER;
# Once deprecation warnings are introduced, this statement shall
# produce warnings
--replace_result $log_file LOG_FILE $log_pos LOG_POS
--eval START REPLICA UNTIL MASTER_LOG_FILE='$log_file', MASTER_LOG_POS=$log_pos
--source include/wait_for_slave_sql_to_stop.inc
--source include/stop_slave.inc
--let $diff_tables=master:t1,slave:t1
--source include/diff_tables.inc
--source include/rpl_connection_master.inc
DROP TABLE t1;
RESET MASTER;
--source include/rpl_connection_slave.inc
DROP TABLE t1;
RESET REPLICA;
RESET MASTER;
--source include/start_slave.inc
--source include/rpl_connection_master.inc

--source include/rpl_end.inc