mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug #42861 Assigning invalid directories to --slave-load-tmpdir crashes the slave
Compiling with debug and assigning an invalid directory to --slave-load-tmpdir was crashing the slave due to the following assertion DBUG_ASSERT(! is_set() || can_overwrite_status). This assertion assumes that a thread can change its state once (i.e. ok,error, etc) before aborting, cleaning/resuming or completing its execution unless the overwrite flag (i.e. can_overwrite_status) is true. The Append_block_log_event::do_apply_event which is responsible for creating temporary file(s) was not cleaning the thread state. Thus a failure while trying to create a file in an invalid temporary directory was causing the crash. To fix the problem we check if the temporary directory is valid before starting the SQL Thread and reset the thread state before creating a file in Append_block_log_event::do_apply_event.
This commit is contained in:
15
mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
Normal file
15
mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
Normal file
@ -0,0 +1,15 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
|
||||
start transaction;
|
||||
insert into t1(b) values (1);
|
||||
insert into t1(b) values (2);
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
commit;
|
||||
Error in Begin_load_query event: write to '../../tmp/SQL_LOAD-2-1-1.data' failed
|
||||
drop table t1;
|
||||
drop table t1;
|
Reference in New Issue
Block a user