Debian Codegraph @

mysql-test/suite/rpl/r/rpl_binlog_errors.result

raw
1 include/master-slave.inc
2 Warnings:
3 Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
4 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.
5 [connection master]
6 #######################################################################
7 ####################### PART 1: MASTER TESTS ##########################
8 #######################################################################
9 include/stop_slave.inc
10 SELECT repeat('x',8192) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data';
11 SELECT repeat('x',10) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data';
12 RESET MASTER;
13 ###################### TEST #1
14 FLUSH LOGS;
15 # assert: must show two binlogs
16 show binary logs;
17 Log_name File_size Encrypted
18 master-bin.000001 # #
19 master-bin.000002 # #
20 ###################### TEST #2
21 RESET MASTER;
22 SET GLOBAL binlog_error_action= IGNORE_ERROR;
23 FLUSH LOGS;
24 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
25
26 # assert: must show one binlog
27 master-bin.000001
28 include/rpl_restart_server.inc [server_number=1]
29 RESET MASTER;
30 ###################### TEST #3
31 CREATE TABLE t1 (a INT);
32 CREATE TABLE t2 (a VARCHAR(16383)) Engine=InnoDB;
33 CREATE TABLE t4 (a VARCHAR(16383)) Engine=MyISAM;
34 INSERT INTO t1 VALUES (1);
35 RESET MASTER;
36 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
37 # assert: must show three binlog
38 show binary logs;
39 Log_name File_size Encrypted
40 master-bin.000001 # #
41 master-bin.000002 # #
42 DELETE FROM t2;
43 RESET MASTER;
44 ###################### TEST #4
45 SET GLOBAL binlog_error_action= IGNORE_ERROR;
46 SELECT count(*) FROM t2;
47 count(*)
48 0
49 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
50 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
51
52 # assert: must still be empty since the LOAD DATA INFILE failed
53 SELECT count(*) FROM t2;
54 count(*)
55 1
56 DELETE FROM t2;
57 include/rpl_restart_server.inc [server_number=1]
58 RESET MASTER;
59 ###################### TEST #5
60 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166-2.data' INTO TABLE t2;
61 # assert: must show one entry
62 SELECT count(*) FROM t2;
63 count(*)
64 1
65 DELETE FROM t2;
66 RESET MASTER;
67 ###################### TEST #6
68 SET GLOBAL binlog_error_action= IGNORE_ERROR;
69 # Table should be empty
70 SELECT count(*) FROM t2;
71 count(*)
72 0
73 SET AUTOCOMMIT=0;
74 INSERT INTO t2 VALUES ('muse');
75 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
76 INSERT INTO t2 VALUES ('muse');
77 COMMIT;
78 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
79
80 # Table should still be empty since the commit failed.
81 SELECT count(*) FROM t2;
82 count(*)
83 3
84 SET AUTOCOMMIT= 1;
85 DELETE FROM t2;
86 include/rpl_restart_server.inc [server_number=1]
87 RESET MASTER;
88 ###################### TEST #7
89 SET GLOBAL binlog_error_action= IGNORE_ERROR;
90 SELECT count(*) FROM t4;
91 count(*)
92 0
93 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
94 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
95
96 # assert: must show 1 entry
97 SELECT count(*) FROM t4;
98 count(*)
99 1
100 DELETE FROM t4;
101 include/rpl_restart_server.inc [server_number=1]
102 RESET MASTER;
103 ###################### TEST #8
104 SET GLOBAL binlog_error_action= IGNORE_ERROR;
105 SET @xxx = REPEAT('xxx', 1000);
106 SET @yyy = REPEAT('yyy', 1000);
107 INSERT INTO t2 VALUES (@xxx),(@yyy);
108 # must show 0 entries
109 SELECT count(*) FROM t4;
110 count(*)
111 0
112 # must show 2 entries
113 SELECT count(*) FROM t2;
114 count(*)
115 2
116 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t4;
117 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
118
119 include/rpl_restart_server.inc [server_number=1]
120 SET GLOBAL binlog_error_action= IGNORE_ERROR;
121 LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug_46166.data' INTO TABLE t2;
122 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
123
124 include/rpl_restart_server.inc [server_number=1]
125 SET GLOBAL binlog_error_action= IGNORE_ERROR;
126 set @aaa = repeat('aaa',1000);
127 set @bbb = repeat('bbb',1000);
128 set @ccc = repeat('ccc',1000);
129 INSERT INTO t2 VALUES (@aaa), (@bbb), (@ccc);
130 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
131
132 # INFO: Count(*) Before Offending DELETEs
133 # assert: must show 1 entry
134 SELECT count(*) FROM t4;
135 count(*)
136 1
137 # assert: must show 2 entries since the LOAD DATA INFILE and
138 # INSERT INTO above was rolled back due to error. Only the
139 # original rows remain
140 SELECT count(*) FROM t2;
141 count(*)
142 6
143 include/rpl_restart_server.inc [server_number=1]
144 SET GLOBAL binlog_error_action= IGNORE_ERROR;
145 SET @xxx = REPEAT('xxx', 1000);
146 SET @yyy = REPEAT('yyy', 1000);
147 DELETE FROM t4 WHERE a IN (@xxx, @yyy) or a <> '1';
148 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
149
150 include/rpl_restart_server.inc [server_number=1]
151 SET GLOBAL binlog_error_action= IGNORE_ERROR;
152 set @aaa = repeat('aaa',1000);
153 set @bbb = repeat('bbb',1000);
154 set @ccc = repeat('ccc',1000);
155 DELETE FROM t2 WHERE a IN (@aaa, @bbb, @ccc) or a <> '1';
156 ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
157
158 # INFO: Count(*) After Offending DELETEs
159 # assert: must show zero entries
160 SELECT count(*) FROM t4;
161 count(*)
162 0
163 # assert: must show 2 entries: the original two rows
164 SELECT count(*) FROM t2;
165 count(*)
166 0
167 DELETE FROM t2;
168 ###################### TEST #9
169 SET GLOBAL binlog_error_action= IGNORE_ERROR;
170 SET SQL_LOG_BIN=0;
171 INSERT INTO t2 VALUES ('aaa'), ('bbb'), ('ccc'), ('ddd');
172 INSERT INTO t4 VALUES ('eee'), ('fff'), ('ggg'), ('hhh');
173 # assert: must show four entries
174 SELECT count(*) FROM t2;
175 count(*)
176 4
177 SELECT count(*) FROM t4;
178 count(*)
179 4
180 DELETE FROM t2;
181 DELETE FROM t4;
182 # assert: must show zero entries
183 SELECT count(*) FROM t2;
184 count(*)
185 0
186 SELECT count(*) FROM t4;
187 count(*)
188 0
189 SET SQL_LOG_BIN=1;
190 ###################### TEST #10
191 call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
192 call mtr.add_suppression("Could not open .*");
193 include/rpl_restart_server.inc [server_number=1]
194 RESET MASTER;
195 SHOW WARNINGS;
196 Level Code Message
197 FLUSH LOGS;
198 ERROR HY000: Can't open file: 'master-bin.000002' (errno: 1 - Operation not permitted)
199 SHOW BINARY LOGS;
200 ERROR HY000: You are not using binary logging
201 CREATE TABLE t5 (a INT);
202 INSERT INTO t4 VALUES ('bbbbb');
203 INSERT INTO t2 VALUES ('aaaaa');
204 DELETE FROM t4;
205 DELETE FROM t2;
206 DROP TABLE t5;
207 ###################### TEST #11
208 include/rpl_restart_server.inc [server_number=1]
209 FLUSH LOGS;
210 ERROR HY000: Can't open file: 'master-bin.index' (errno: 1 - Operation not permitted)
211 RESET MASTER;
212 CREATE TABLE t5 (a INT);
213 INSERT INTO t4 VALUES ('bbbbb');
214 INSERT INTO t2 VALUES ('aaaaa');
215 DELETE FROM t4;
216 DELETE FROM t2;
217 DROP TABLE t5;
218 include/rpl_restart_server.inc [server_number=1]
219 ###################### TEST #12
220 FLUSH LOGS;
221 ERROR HY000: Error writing file 'master-bin' (errno: 2 - No such file or directory)
222 RESET MASTER;
223 CREATE TABLE t5 (a INT);
224 INSERT INTO t4 VALUES ('bbbbb');
225 INSERT INTO t2 VALUES ('aaaaa');
226 DELETE FROM t4;
227 DELETE FROM t2;
228 DROP TABLE t5;
229 include/rpl_restart_server.inc [server_number=1]
230 DROP TABLE t1, t2, t4;
231 RESET MASTER;
232 include/start_slave.inc
233 #######################################################################
234 ####################### PART 2: SLAVE TESTS ###########################
235 #######################################################################
236 include/rpl_reset.inc
237 call mtr.add_suppression("Replica I/O for channel '': Relay log write failure: could not queue event from source.*");
238 call mtr.add_suppression("Error writing file .*");
239 call mtr.add_suppression("Could not open .*");
240 call mtr.add_suppression("MYSQL_BIN_LOG::open failed to sync the index file.");
241 call mtr.add_suppression("Can't generate a unique log-filename .*");
242 ###################### TEST #13
243 SET GLOBAL binlog_error_action= IGNORE_ERROR;
244 SET @old_debug=@@global.debug;
245 include/stop_slave.inc
246 SET GLOBAL debug="+d,error_unique_log_filename";
247 START REPLICA io_thread;
248 include/wait_for_slave_io_error.inc [errno=13122]
249 Last_IO_Error = 'Relay log write failure: could not queue event from source'
250 SET GLOBAL debug="-d,error_unique_log_filename";
251 SET GLOBAL debug=@old_debug;
252 include/rpl_restart_server.inc [server_number=2]
253 ###################### TEST #14
254 SET GLOBAL binlog_error_action= IGNORE_ERROR;
255 SET @old_debug=@@global.debug;
256 include/stop_slave.inc
257 SET GLOBAL debug="+d,fault_injection_new_file_rotate_event";
258 START REPLICA io_thread;
259 include/wait_for_slave_io_error.inc [errno=13122]
260 Last_IO_Error = 'Relay log write failure: could not queue event from source'
261 SET GLOBAL debug="-d,fault_injection_new_file_rotate_event";
262 SET GLOBAL debug=@old_debug;
263 include/rpl_restart_server.inc [server_number=2]
264 ###################### TEST #15
265 SET GLOBAL binlog_error_action= IGNORE_ERROR;
266 SET @old_debug=@@global.debug;
267 include/stop_slave.inc
268 SET GLOBAL debug="+d,fault_injection_registering_index";
269 START REPLICA io_thread;
270 include/wait_for_slave_io_error.inc [errno=13122]
271 Last_IO_Error = 'Relay log write failure: could not queue event from source'
272 SET GLOBAL debug="-d,fault_injection_registering_index";
273 SET GLOBAL debug=@old_debug;
274 include/rpl_restart_server.inc [server_number=2]
275 ###################### TEST #16
276 SET GLOBAL binlog_error_action= IGNORE_ERROR;
277 SET @old_debug=@@global.debug;
278 include/stop_slave.inc
279 SET GLOBAL debug="+d,fault_injection_openning_index";
280 START REPLICA io_thread;
281 include/wait_for_slave_io_error.inc [errno=13122]
282 Last_IO_Error = 'Relay log write failure: could not queue event from source'
283 SET GLOBAL debug="-d,fault_injection_openning_index";
284 SET GLOBAL debug=@old_debug;
285 include/rpl_restart_server.inc [server_number=2]
286 include/stop_slave_sql.inc
287 Warnings:
288 Note 3084 Replication thread(s) for channel '' are already stopped.
289 RESET SLAVE;
290 Warnings:
291 Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead
292 RESET MASTER;
293 include/rpl_end.inc