mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
With statement- or mixed-mode logging, "LOAD DATA INFILE" queries are written to the binlog using special types of log events. When mysqlbinlog reads such events, it re-creates the file in a temporary directory with a generated filename and outputs a "LOAD DATA INFILE" query where the filename is replaced by the generated file. The temporary file is not deleted by mysqlbinlog after termination. To fix the problem, in mixed mode we go to row-based. In SBR, we document it to remind user the tmpfile is left in a temporary directory. mysql-test/extra/rpl_tests/rpl_loaddata.test: Updated for Bug#34283 mysql-test/suite/binlog/r/binlog_mixed_load_data.result: Test result for BUG#34283. mysql-test/suite/binlog/t/binlog_killed_simulate.test: Updated for Bug#34283 mysql-test/suite/binlog/t/binlog_mixed_load_data.test: Added the test file to verify that 'load data infile...' statement will go to row-based in mixed mode. mysql-test/suite/binlog/t/binlog_stm_blackhole.test: Updated for Bug#34283 mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_loaddata_fatal.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_loaddata_map.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test: Updated for Bug#34283 mysql-test/suite/rpl/t/rpl_stm_log.test: Updated for Bug#34283 sql/sql_load.cc: Added code to go to row-based in mixed mode for 'load data infile ...' statement
50 lines
1.8 KiB
Plaintext
50 lines
1.8 KiB
Plaintext
##########################################################################
|
|
# This test verifies if the slave fails gracefully when the temporary
|
|
# file used to load data is removed while it is about to be used it.
|
|
# Similar errors are caught if the temporary directory is removed.
|
|
#
|
|
# Steps:
|
|
# 1 - Creates a table and populates it through "LOAD DATA INFILE".
|
|
# 2 - Catches error.
|
|
##########################################################################
|
|
|
|
--source include/have_binlog_format_statement.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_debug.inc
|
|
--source include/master-slave.inc
|
|
--source include/not_embedded.inc
|
|
|
|
##########################################################################
|
|
# Loading data
|
|
##########################################################################
|
|
connection master;
|
|
|
|
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;
|
|
|
|
##########################################################################
|
|
# Catch Error
|
|
##########################################################################
|
|
connection slave;
|
|
# Errno 9 is what we get although it's wrong (see BUG#52768).
|
|
--let $slave_sql_errno= 9
|
|
--source include/wait_for_slave_sql_error.inc
|
|
|
|
##########################################################################
|
|
# Clean up
|
|
##########################################################################
|
|
connection master;
|
|
|
|
drop table t1;
|
|
|
|
connection slave;
|
|
|
|
drop table t1;
|
|
|
|
call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");
|