File: rpl_binlog_errors.result

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 (293 lines) | stat: -rw-r--r-- 9,935 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
include/master-slave.inc
Warnings:
Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
Note	####	Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.
[connection master]
#######################################################################
####################### PART 1: MASTER TESTS ##########################
#######################################################################
include/stop_slave.inc
SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data';
SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data';
RESET MASTER;
###################### TEST #1
FLUSH LOGS;
# assert: must show two binlogs
show binary logs;
Log_name	File_size	Encrypted
master-bin.000001	#	#
master-bin.000002	#	#
###################### TEST #2
RESET MASTER;
SET GLOBAL binlog_error_action= IGNORE_ERROR;
FLUSH LOGS;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

# assert: must show one binlog
master-bin.000001
include/rpl_restart_server.inc [server_number=1]
RESET MASTER;
###################### TEST #3
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a VARCHAR(16383)) Engine=InnoDB;
CREATE TABLE t4 (a VARCHAR(16383)) Engine=MyISAM;
INSERT INTO t1 VALUES (1);
RESET MASTER;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
# assert: must show three binlog
show binary logs;
Log_name	File_size	Encrypted
master-bin.000001	#	#
master-bin.000002	#	#
DELETE FROM t2;
RESET MASTER;
###################### TEST #4
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SELECT count(*) FROM t2;
count(*)
0
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

# assert: must still be empty since the LOAD DATA INFILE failed
SELECT count(*) FROM t2;
count(*)
1
DELETE FROM t2;
include/rpl_restart_server.inc [server_number=1]
RESET MASTER;
###################### TEST #5
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
# assert: must show one entry
SELECT count(*) FROM t2;
count(*)
1
DELETE FROM t2;
RESET MASTER;
###################### TEST #6
SET GLOBAL binlog_error_action= IGNORE_ERROR;
# Table should be empty
SELECT count(*) FROM t2;
count(*)
0
SET AUTOCOMMIT=0;
INSERT INTO t2 VALUES ('muse');
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
INSERT INTO t2 VALUES ('muse');
COMMIT;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

# Table should still be empty since the commit failed.
SELECT count(*) FROM t2;
count(*)
3
SET AUTOCOMMIT= 1;
DELETE FROM t2;
include/rpl_restart_server.inc [server_number=1]
RESET MASTER;
###################### TEST #7
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SELECT count(*) FROM t4;
count(*)
0
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

# assert: must show 1 entry
SELECT count(*) FROM t4;
count(*)
1
DELETE FROM t4;
include/rpl_restart_server.inc [server_number=1]
RESET MASTER;
###################### TEST #8
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET @xxx = REPEAT('xxx', 1000);
SET @yyy = REPEAT('yyy', 1000);
INSERT INTO t2 VALUES (@xxx),(@yyy);
# must show 0 entries
SELECT count(*) FROM t4;
count(*)
0
# must show 2 entries
SELECT count(*) FROM t2;
count(*)
2
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

include/rpl_restart_server.inc [server_number=1]
SET GLOBAL binlog_error_action= IGNORE_ERROR;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

include/rpl_restart_server.inc [server_number=1]
SET GLOBAL binlog_error_action= IGNORE_ERROR;
set @aaa = repeat('aaa',1000);
set @bbb = repeat('bbb',1000);
set @ccc = repeat('ccc',1000);
INSERT INTO t2 VALUES (@aaa), (@bbb), (@ccc);
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

# INFO: Count(*) Before Offending DELETEs
# assert: must show 1 entry
SELECT count(*) FROM t4;
count(*)
1
# assert: must show 2 entries since the LOAD DATA INFILE and
# INSERT INTO above was rolled back due to error. Only the
# original rows remain
SELECT count(*) FROM t2;
count(*)
6
include/rpl_restart_server.inc [server_number=1]
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET @xxx = REPEAT('xxx', 1000);
SET @yyy = REPEAT('yyy', 1000);
DELETE FROM t4 WHERE a IN (@xxx, @yyy) or a <> '1';
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

include/rpl_restart_server.inc [server_number=1]
SET GLOBAL binlog_error_action= IGNORE_ERROR;
set @aaa = repeat('aaa',1000);
set @bbb = repeat('bbb',1000);
set @ccc = repeat('ccc',1000);
DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) or a <> '1';
ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)

# INFO: Count(*) After Offending DELETEs
# assert: must show zero entries
SELECT count(*) FROM t4;
count(*)
0
# assert: must show 2 entries: the original two rows
SELECT count(*) FROM t2;
count(*)
0
DELETE FROM t2;
###################### TEST #9
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET SQL_LOG_BIN=0;
INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
# assert: must show four entries
SELECT count(*) FROM t2;
count(*)
4
SELECT count(*) FROM t4;
count(*)
4
DELETE FROM t2;
DELETE FROM t4;
# assert: must show zero entries
SELECT count(*) FROM t2;
count(*)
0
SELECT count(*) FROM t4;
count(*)
0
SET SQL_LOG_BIN=1;
###################### TEST #10
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Could not open .*");
include/rpl_restart_server.inc [server_number=1]
RESET MASTER;
SHOW WARNINGS;
Level	Code	Message
FLUSH LOGS;
ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1 - Operation not permitted)
SHOW BINARY LOGS;
ERROR HY000: You are not using binary logging
CREATE TABLE t5 (a INT);
INSERT INTO t4 VALUES ('bbbbb');
INSERT INTO t2 VALUES ('aaaaa');
DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
###################### TEST #11
include/rpl_restart_server.inc [server_number=1]
FLUSH LOGS;
ERROR HY000: Can't open file: 'master-bin.index' (errno: 1 - Operation not permitted)
RESET MASTER;
CREATE TABLE t5 (a INT);
INSERT INTO t4 VALUES ('bbbbb');
INSERT INTO t2 VALUES ('aaaaa');
DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
include/rpl_restart_server.inc [server_number=1]
###################### TEST #12
FLUSH LOGS;
ERROR HY000: Error writing file 'master-bin' (errno: 2 - No such file or directory)
RESET MASTER;
CREATE TABLE t5 (a INT);
INSERT INTO t4 VALUES ('bbbbb');
INSERT INTO t2 VALUES ('aaaaa');
DELETE FROM t4;
DELETE FROM t2;
DROP TABLE t5;
include/rpl_restart_server.inc [server_number=1]
DROP TABLE t1, t2, t4;
RESET MASTER;
include/start_slave.inc
#######################################################################
####################### PART 2: SLAVE TESTS ###########################
#######################################################################
include/rpl_reset.inc
call mtr.add_suppression("Replica I/O for channel '': Relay log write failure: could not queue event from source.*");
call mtr.add_suppression("Error writing file .*");
call mtr.add_suppression("Could not open .*");
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
call mtr.add_suppression("Can't generate a unique log-filename .*");
###################### TEST #13
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET @old_debug=@@global.debug;
include/stop_slave.inc
SET GLOBAL debug="+d,error_unique_log_filename";
START REPLICA io_thread;
include/wait_for_slave_io_error.inc [errno=13122]
Last_IO_Error = 'Relay log write failure: could not queue event from source'
SET GLOBAL debug="-d,error_unique_log_filename";
SET GLOBAL debug=@old_debug;
include/rpl_restart_server.inc [server_number=2]
###################### TEST #14
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET @old_debug=@@global.debug;
include/stop_slave.inc
SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
START REPLICA io_thread;
include/wait_for_slave_io_error.inc [errno=13122]
Last_IO_Error = 'Relay log write failure: could not queue event from source'
SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
SET GLOBAL debug=@old_debug;
include/rpl_restart_server.inc [server_number=2]
###################### TEST #15
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET @old_debug=@@global.debug;
include/stop_slave.inc
SET GLOBAL debug="+d,fault_injection_registering_index";
START REPLICA io_thread;
include/wait_for_slave_io_error.inc [errno=13122]
Last_IO_Error = 'Relay log write failure: could not queue event from source'
SET GLOBAL debug="-d,fault_injection_registering_index";
SET GLOBAL debug=@old_debug;
include/rpl_restart_server.inc [server_number=2]
###################### TEST #16
SET GLOBAL binlog_error_action= IGNORE_ERROR;
SET @old_debug=@@global.debug;
include/stop_slave.inc
SET GLOBAL debug="+d,fault_injection_openning_index";
START REPLICA io_thread;
include/wait_for_slave_io_error.inc [errno=13122]
Last_IO_Error = 'Relay log write failure: could not queue event from source'
SET GLOBAL debug="-d,fault_injection_openning_index";
SET GLOBAL debug=@old_debug;
include/rpl_restart_server.inc [server_number=2]
include/stop_slave_sql.inc
Warnings:
Note	3084	Replication thread(s) for channel '' are already stopped.
RESET SLAVE;
Warnings:
Warning	1287	'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
RESET MASTER;
include/rpl_end.inc