@@ -39,10 +39,31 @@ master-bin.000001 # Query # # COMMIT
39
39
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */
40
40
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
41
41
FLUSH STATUS;
42
+
43
+ # 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
44
+ # when 'DROP DATABASE' fails and at least one table is deleted
45
+ # from the database.
46
+ RESET MASTER;
47
+ CREATE DATABASE testing_1;
48
+ USE testing_1;
49
+ CREATE TABLE t1(c1 INT);
50
+ CREATE TABLE t2(c1 INT);
51
+ # Create a file in the database directory
52
+ SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE';
53
+
54
+ # 'DROP DATABASE' will fail if there is any other file in the the
55
+ # database directory
56
+ DROP DATABASE testing_1;
57
+ ERROR HY000: Error dropping database (can't rmdir './testing_1/', errno: 17)
58
+
59
+ # Remove the fake file.
60
+ # Now we can drop the database.
61
+ DROP DATABASE testing_1;
42
62
#
43
63
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
44
64
# BASED REPLICATION
45
65
#
66
+ USE test;
46
67
DROP DATABASE IF EXISTS db1;
47
68
DROP TABLE IF EXISTS t3;
48
69
CREATE DATABASE db1;
@@ -58,7 +79,7 @@ Tables_in_db1
58
79
t2
59
80
show binlog events from <binlog_start>;
60
81
Log_name Pos Event_type Server_id End_log_pos Info
61
- master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
82
+ master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1`
62
83
DROP TABLE t3;
63
84
DROP DATABASE db1;
64
85
set binlog_format=mixed;
@@ -102,10 +123,31 @@ master-bin.000001 # Query # # COMMIT
102
123
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt1` /* generated by server */
103
124
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
104
125
FLUSH STATUS;
126
+
127
+ # 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
128
+ # when 'DROP DATABASE' fails and at least one table is deleted
129
+ # from the database.
130
+ RESET MASTER;
131
+ CREATE DATABASE testing_1;
132
+ USE testing_1;
133
+ CREATE TABLE t1(c1 INT);
134
+ CREATE TABLE t2(c1 INT);
135
+ # Create a file in the database directory
136
+ SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE';
137
+
138
+ # 'DROP DATABASE' will fail if there is any other file in the the
139
+ # database directory
140
+ DROP DATABASE testing_1;
141
+ ERROR HY000: Error dropping database (can't rmdir './testing_1/', errno: 17)
142
+
143
+ # Remove the fake file.
144
+ # Now we can drop the database.
145
+ DROP DATABASE testing_1;
105
146
#
106
147
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
107
148
# BASED REPLICATION
108
149
#
150
+ USE test;
109
151
DROP DATABASE IF EXISTS db1;
110
152
DROP TABLE IF EXISTS t3;
111
153
CREATE DATABASE db1;
@@ -121,7 +163,7 @@ Tables_in_db1
121
163
t2
122
164
show binlog events from <binlog_start>;
123
165
Log_name Pos Event_type Server_id End_log_pos Info
124
- master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
166
+ master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1`
125
167
DROP TABLE t3;
126
168
DROP DATABASE db1;
127
169
set binlog_format=row;
@@ -166,10 +208,31 @@ master-bin.000001 # Query # # COMMIT
166
208
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tt1` /* generated by server */
167
209
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
168
210
FLUSH STATUS;
211
+
212
+ # 'DROP TABLE IF EXISTS <deleted tables>' is binlogged
213
+ # when 'DROP DATABASE' fails and at least one table is deleted
214
+ # from the database.
215
+ RESET MASTER;
216
+ CREATE DATABASE testing_1;
217
+ USE testing_1;
218
+ CREATE TABLE t1(c1 INT);
219
+ CREATE TABLE t2(c1 INT);
220
+ # Create a file in the database directory
221
+ SELECT 'hello' INTO OUTFILE 'fake_file.FAKE_FILE';
222
+
223
+ # 'DROP DATABASE' will fail if there is any other file in the the
224
+ # database directory
225
+ DROP DATABASE testing_1;
226
+ ERROR HY000: Error dropping database (can't rmdir './testing_1/', errno: 17)
227
+
228
+ # Remove the fake file.
229
+ # Now we can drop the database.
230
+ DROP DATABASE testing_1;
169
231
#
170
232
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
171
233
# BASED REPLICATION
172
234
#
235
+ USE test;
173
236
DROP DATABASE IF EXISTS db1;
174
237
DROP TABLE IF EXISTS t3;
175
238
CREATE DATABASE db1;
@@ -185,7 +248,7 @@ Tables_in_db1
185
248
t2
186
249
show binlog events from <binlog_start>;
187
250
Log_name Pos Event_type Server_id End_log_pos Info
188
- master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
251
+ master-bin.000001 # Query # # use `db1`; DROP TABLE IF EXISTS `t1`
189
252
DROP TABLE t3;
190
253
DROP DATABASE db1;
191
254
show databases;
0 commit comments