File: rpl_open_temp_tables_warning.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 (60 lines) | stat: -rw-r--r-- 2,471 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
#
# ==== Purpose ====
#
# This test checks if the variable Replica_open_temp_tables is set
# to the correct number of temporary tables open in the slave and if
# the corresponding warning is correctly issued.
#
# ==== Implementation ====
# A temporary table is first created. The slave replication thread is
# stopped so that the corresponding warning is generated. Finally, the
# temporary table is dropped to verify that the number of open tables
# decreased to zero and, consequently, that no warning is issued when
# stopping the slave's replication thread again.
#
#
# ==== References ====
#
# Bug#21357008: REPLICA_OPEN_TEMP_TABLES WRONG AFTER RESET SLAVE WHEN
#               USING MULTI-SOURCE



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

# Create temporary table.
CREATE TEMPORARY TABLE t1 (a INT);
--source include/sync_slave_sql_with_master.inc

--let $status= SHOW STATUS LIKE 'Replica_open_temp_tables'
--let $num_open_tables= query_get_value($status, Value, 1)
--let $correct_num_open_tables= 1
--let $assert_cond= $correct_num_open_tables = $num_open_tables
--let $assert_text= Replica_open_temp_tables is correctly set to $correct_num_open_tables after creating a temp table
--source include/assert.inc

# Stopping the replication thread does not delete tables and does not
# affect the status variable. It also generates a warning because there
# are open temporary tables in the slave.
--source include/stop_slave.inc
--let $num_open_tables= query_get_value($status, Value, 1)
--let $assert_cond= $correct_num_open_tables = $num_open_tables
--let $assert_text= Replica_open_temp_tables is correctly set to $correct_num_open_tables after stopping the replication thread
--source include/assert.inc

# Dropping the table that is still open will decrease the value to zero.
--source include/start_slave.inc
--source include/rpl_connection_master.inc
DROP TEMPORARY TABLE t1;
--source include/sync_slave_sql_with_master.inc
--let $num_open_tables= query_get_value($status, Value, 1)
--let $correct_num_open_tables= 0
--let $assert_cond= $correct_num_open_tables = $num_open_tables
--let $assert_text= Replica_open_temp_tables is correctly set to $correct_num_open_tables after dropping the temporary table
--source include/assert.inc

# Stopping the slave will not generate a warning because there are no open tables.
--source include/stop_slave.inc
--let $rpl_only_running_threads= 1
--source include/rpl_end.inc