mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#38174 secure-file-priv breaks LOAD DATA INFILE replication in statement mode
If secure-file-priv was set on slave, it became unable to execute LOAD DATA INFILE statements sent from master using mixed or statement-based replication. This patch fixes the issue by ignoring this security restriction and checking if the files are created and read by the slave in the --slave-load-tmpdir while executing the SQL Thread.
This commit is contained in:
10
mysql-test/suite/rpl/r/rpl_slave_load_in.result
Normal file
10
mysql-test/suite/rpl/r/rpl_slave_load_in.result
Normal file
@ -0,0 +1,10 @@
|
||||
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));
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
Comparing tables master:test.t1 and slave:test.t1
|
||||
drop table t1;
|
35
mysql-test/suite/rpl/t/rpl_slave_load_in.test
Normal file
35
mysql-test/suite/rpl/t/rpl_slave_load_in.test
Normal file
@ -0,0 +1,35 @@
|
||||
##########################################################################
|
||||
# This test verifies if a slave is able to process a "LOAD DATA INFILE"
|
||||
# event while the "--secure-file-priv" option is set.
|
||||
#
|
||||
# The test is divided in two steps:
|
||||
# 1 - Creates a table and populates it through "LOAD DATA INFILE".
|
||||
# 2 - Compares the master and slave.
|
||||
##########################################################################
|
||||
source include/master-slave.inc;
|
||||
|
||||
##########################################################################
|
||||
# Loading data
|
||||
##########################################################################
|
||||
connection master;
|
||||
|
||||
create table t1(a int not null auto_increment, b int, primary key(a));
|
||||
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
||||
|
||||
##########################################################################
|
||||
# Checking Consistency
|
||||
##########################################################################
|
||||
sync_slave_with_master;
|
||||
|
||||
let $diff_table_1=master:test.t1;
|
||||
let $diff_table_2=slave:test.t1;
|
||||
source include/diff_tables.inc;
|
||||
|
||||
##########################################################################
|
||||
# Clean up
|
||||
##########################################################################
|
||||
connection master;
|
||||
|
||||
drop table t1;
|
||||
|
||||
sync_slave_with_master;
|
Reference in New Issue
Block a user