File: rpl_drop_temp.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 (115 lines) | stat: -rw-r--r-- 2,834 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
##############################################
# Change Author: JBM
# Change Date: 2006-02-07
# Change: Added ENGINE=MyISAM
# Purpose: According to TU in 16552 This is how
# to work around NDB's issue with temp tables
##############################################
source include/master-slave.inc;
source include/have_myisam.inc;
source include/have_binlog_format_mixed_or_statement.inc;

--disable_warnings
create database if not exists mysqltest;
--enable_warnings

connect (con_temp,127.0.0.1,root,,test,$MASTER_MYPORT,);

connection con_temp;
use mysqltest;
create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
create temporary table mysqltest.t2 (n int)ENGINE=MyISAM;

disconnect con_temp;
--source include/wait_until_disconnected.inc

connection master;
if (`SELECT @@SESSION.binlog_format = 'STATEMENT'`)
{
  -- let $wait_binlog_event= DROP
  -- source include/wait_for_binlog_event.inc
}
sync_slave_with_master;
connection slave;
show status like 'Replica_open_temp_tables';
# Cleanup
connection master;
drop database mysqltest;
sync_slave_with_master;

#
# Bug#49137
# This test verifies if DROP MULTI TEMPORARY TABLE 
# causes different errors on master and slave and breaks
# replication, when one or more of these tables do not
# exist.
#
# Nowadays, we don't drop any tables in multi-table DROP
# TABLE (without IF EXISTS clause) if one of them does not
# exist. So the first part is less relevant currently.
#
connection master;
DROP TEMPORARY TABLE IF EXISTS tmp1;
CREATE TEMPORARY TABLE t1 ( a int );
--error 1051
DROP TEMPORARY TABLE t1, t2;
--error 1051
DROP TEMPORARY TABLE tmp2;
sync_slave_with_master;

# Clean-up.
connection master;
DROP TEMPORARY TABLE t1;
sync_slave_with_master;

#
# However, we still can end-up in situation when some temporary
# table dropped on master and logged as such, does not exist
# on slave. The second part of the test covers this situation.
#
connection slave;
stop slave;
wait_for_slave_to_stop;

--echo **** On Master ****
connection master;
CREATE TEMPORARY TABLE tmp3 (a int);
DROP TEMPORARY TABLE tmp3;

connection slave;
START SLAVE;

connection master;
sync_slave_with_master;


#
# BUG#54842: DROP TEMPORARY TABLE not binlogged after manual switching binlog format to ROW
#

--source include/rpl_reset.inc
--connection master

CREATE TABLE t1 ( i INT );
--sync_slave_with_master
SHOW STATUS LIKE 'Replica_open_temp_tables';

--connect(con1,localhost,root,,)
CREATE TEMPORARY TABLE ttmp1 ( i INT );
--disconnect con1

-- connection master
if (`SELECT @@SESSION.binlog_format = 'STATEMENT'`)
{
  --let $wait_binlog_event= DROP
  --source include/wait_for_binlog_event.inc
}
--sync_slave_with_master
SHOW STATUS LIKE 'Replica_open_temp_tables';

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

# End of 4.1 tests
--source include/rpl_end.inc