File: rpl_change_master_open_temp_tables.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 (97 lines) | stat: -rw-r--r-- 2,959 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
# ==== Purpose ====
#
# This test script serves as the functionality testing for
# WL#6120- Change master without stopping Slave threads.
#
# This test script does the following:

#  - Temporary table(s) should NOT be dropped if applier is running during
#    CHANGE MASTER.
#  - If there are open temporary tables and there is a STOP SLAVE/
#    STOP SLAVE[IO_THREAD/SQL_THREAD]there should be a warning.
#  - If there are open temporary tables and there is a CHANGE MASTER,
#    there should be a warning.
#  - There is no warning if the change master option only changes connection
#    or execution configuration.
#
#  ==== Related Worklog(s) And Bug(s)====
#
#  WL#6120- Change master without stopping Slave threads.
#

--source include/master-slave.inc
--source include/have_binlog_format_statement.inc

--echo
--echo # create a temporary table, replicate at slave for all the tests below.
--echo

CREATE TEMPORARY TABLE t1(a int);
--source include/sync_slave_sql_with_master.inc

--echo
--echo # Make sure STOP SLAVE generates a warning.
--echo

STOP SLAVE;
--source include/wait_for_slave_to_stop.inc

--echo
--echo # Make sure STOP SLAVE SQL_THREAD generates a warning.
--echo

STOP SLAVE SQL_THREAD;
--source include/wait_for_slave_sql_to_stop.inc

--echo
--echo # Make sure STOP SLAVE IO_THREAD generates a warning.
--echo

STOP SLAVE IO_THREAD;
--source include/wait_for_slave_io_to_stop.inc

--echo
--echo # No warning here since we are changing a configuration parameter only.
--echo

CHANGE REPLICATION SOURCE TO SOURCE_HEARTBEAT_PERIOD= 10;

--echo
--echo # Use of (master/relay)log_file/log_pos options should generate a warning.
--echo

--let $save_autoposition= query_get_value(SHOW SLAVE STATUS, Auto_Position, 1)
CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION= 0;

let $master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
replace_result $master_log_file MASTER_LOG_FILE;
eval CHANGE REPLICATION SOURCE TO SOURCE_LOG_FILE= '$master_log_file';

let $master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
replace_result $master_log_pos MASTER_LOG_POS;
eval CHANGE REPLICATION SOURCE TO SOURCE_LOG_POS= $master_log_pos;

let $relay_log_file= query_get_value(SHOW SLAVE STATUS, Relay_Log_File, 1);
replace_result $relay_log_file RELAY_LOG_FILE;
eval CHANGE REPLICATION SOURCE TO RELAY_LOG_FILE= '$relay_log_file';

let $relay_log_pos= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1);
replace_result $relay_log_pos RELAY_LOG_POS;
--disable_warnings
eval CHANGE REPLICATION SOURCE TO RELAY_LOG_POS= $relay_log_pos;
--enable_warnings
# Do SHOW WARINGS explicitly to avoid replace_result affecting the output
SHOW WARNINGS;

--replace_result $save_autoposition SAVE_AUTOPOSITION
eval CHANGE REPLICATION SOURCE TO SOURCE_AUTO_POSITION= $save_autoposition;

--echo
--echo # cleanup
--echo

--source include/start_slave.inc
--connection master
DROP TEMPORARY TABLE t1;

--source include/rpl_end.inc