3
# Verify that Slave_open_temp_tables is increased when a temporary
4
# table is opened on the slave, and decreased when a temporary table
5
# is closed on the slave, and that it is preserved during 'DELETE FROM
6
# table' and 'TRUNCATE table'.
10
# Create a temporary table on master, insert rows, and try:
11
# - delete rows from the table
12
# - truncate the table
15
# ==== Related bugs ====
17
# BUG#17137 Running "truncate table" on temporary table leaves the table open on a slave
19
# Bug in this test: BUG#37493: rpl_trunc_temp.test nondeterministic
22
# Requires statement-based logging since temporary tables are not
23
# logged in row-based logging
24
-- source include/have_binlog_format_mixed_or_statement.inc
26
source include/master-slave.inc;
28
create temporary table t1 (n int);
29
insert into t1 values(1);
30
sync_slave_with_master;
31
show status like 'Slave_open_temp_tables';
33
# Perform a delete from temp table
36
sync_slave_with_master;
37
show status like 'Slave_open_temp_tables';
39
# Perform truncate on temp table
42
sync_slave_with_master;
43
show status like 'Slave_open_temp_tables';
45
# Disconnect the master, temp table on slave should dissapear
50
# Wait until drop of temp tables appers in slave's binlog
51
let $wait_binlog_event= DROP;
52
source include/wait_for_binlog_event.inc;
54
show status like 'Slave_open_temp_tables';