Skip to content

Commit 2d71cea

Browse files
author
Luis Soares
committed
Automerge from bug branch.
2 parents f52bbe0 + 0c906be commit 2d71cea

File tree

4 files changed

+25
-55
lines changed

4 files changed

+25
-55
lines changed

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

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,47 +10,7 @@ insert into t1(b) values (1);
1010
insert into t1(b) values (2);
1111
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
1212
commit;
13-
show slave status;
14-
Slave_IO_State #
15-
Master_Host 127.0.0.1
16-
Master_User root
17-
Master_Port MASTER_MYPORT
18-
Connect_Retry 1
19-
Master_Log_File master-bin.000001
20-
Read_Master_Log_Pos #
21-
Relay_Log_File #
22-
Relay_Log_Pos #
23-
Relay_Master_Log_File master-bin.000001
24-
Slave_IO_Running Yes
25-
Slave_SQL_Running No
26-
Replicate_Do_DB
27-
Replicate_Ignore_DB
28-
Replicate_Do_Table
29-
Replicate_Ignore_Table
30-
Replicate_Wild_Do_Table
31-
Replicate_Wild_Ignore_Table
32-
Last_Errno 9
33-
Last_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
34-
Skip_Counter 0
35-
Exec_Master_Log_Pos #
36-
Relay_Log_Space #
37-
Until_Condition None
38-
Until_Log_File
39-
Until_Log_Pos 0
40-
Master_SSL_Allowed No
41-
Master_SSL_CA_File
42-
Master_SSL_CA_Path
43-
Master_SSL_Cert
44-
Master_SSL_Cipher
45-
Master_SSL_Key
46-
Seconds_Behind_Master #
47-
Master_SSL_Verify_Server_Cert No
48-
Last_IO_Errno #
49-
Last_IO_Error #
50-
Last_SQL_Errno 9
51-
Last_SQL_Error Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
52-
Replicate_Ignore_Server_Ids
53-
Master_Server_Id 1
5413
drop table t1;
5514
drop table t1;
56-
call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");
15+
call mtr.add_suppression("Slave: Can't get stat of .*");
16+
call mtr.add_suppression("Slave: File.* not found.*");

mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,17 @@ commit;
3333
connection slave;
3434
source include/wait_for_slave_sql_to_stop.inc;
3535

36-
--replace_result $MASTER_MYPORT MASTER_MYPORT
37-
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
38-
--replace_regex /SQL_LOAD-[0-9]-[0-9]-[0-9]*/SQL_LOAD/
39-
query_vertical show slave status;
36+
--let $error= query_get_value(SHOW SLAVE STATUS, Last_Errno, 1)
37+
# windows and linux different error numbers here:
38+
# Windows:
39+
# - Last_Errno 29 (File not found)
40+
# Unix like OS:
41+
# - Last_Errno 13 (Can't stat file)
42+
--let $assertion= `SELECT $error=29 OR $error=13`
43+
if (!$assertion)
44+
{
45+
--echo UNEXPECTED ERROR NUMBER: $error
46+
}
4047

4148
##########################################################################
4249
# Clean up
@@ -49,4 +56,5 @@ connection slave;
4956

5057
drop table t1;
5158

52-
call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");
59+
call mtr.add_suppression("Slave: Can't get stat of .*");
60+
call mtr.add_suppression("Slave: File.* not found.*");

mysql-test/suite/rpl/t/rpl_sync.test

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,15 @@ stop slave IO_THREAD;
6464
source include/wait_for_slave_io_to_stop.inc;
6565

6666
let $file= query_get_value("SHOW SLAVE STATUS", Relay_Log_File, 1);
67-
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
68-
--exec echo "failure" > $MYSQLD_SLAVE_DATADIR/$file
67+
68+
--let FILE_TO_CORRUPT= $MYSQLD_SLAVE_DATADIR/$file
69+
perl;
70+
$file= $ENV{'FILE_TO_CORRUPT'};
71+
open(FILE, ">$file") || die "Unable to open $file.";
72+
truncate(FILE,0);
73+
print FILE "failure";
74+
close ($file);
75+
EOF
6976

7077
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.2.expect
7178
SET SESSION debug="d,crash_before_rotate_relaylog";
@@ -102,9 +109,6 @@ insert into t1(a) values(8);
102109
insert into t1(a) values(9);
103110

104111
connection slave;
105-
--replace_result $MYSQLD_SLAVE_DATADIR MYSQLD_SLAVE_DATADIR
106-
--exec cat $MYSQLD_SLAVE_DATADIR/master.backup > $MYSQLD_SLAVE_DATADIR/master.info
107-
108112
let MYSQLD_SLAVE_DATADIR=`select @@datadir`;
109113

110114
--perl

sql/log_event.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6449,9 +6449,7 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli)
64496449

64506450
DBUG_EXECUTE_IF("remove_slave_load_file_before_write",
64516451
{
6452-
mysql_file_close(fd, MYF(0));
6453-
fd= -1;
6454-
mysql_file_delete(0, fname, MYF(0));
6452+
my_delete_allow_opened(fname, MYF(0));
64556453
});
64566454

64576455
if (mysql_file_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP)))

0 commit comments

Comments
 (0)