mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
3b974039f7
Bug 571: play LOAD DATA INFILE the same way on the slave as it was on the master: if it was with IGNORE, do it with IGNORE, if it was with REPLACE, do it with REPLACE, and (the change) if it was with nothing, do it with nothing (not with IGNORE !!). Bug 573: print a proper error message in case of duplicate entry in LOAD DATA INFILE on the slave, i.e. a message where the keyname and key value appear : 'Duplicate entry '1' for key 1' and not 'Duplicate entry '%-.64s' for key %d'
50 lines
1.5 KiB
Text
50 lines
1.5 KiB
Text
# See if replication of a "LOAD DATA in an autoincrement column"
|
|
# Honours autoincrement values
|
|
# i.e. if the master and slave have the same sequence
|
|
#
|
|
# check replication of load data for temporary tables with additional parameters
|
|
#
|
|
# check if duplicate entries trigger an error (they should unless IGNORE or
|
|
# REPLACE was used on the master) (bug 571).
|
|
|
|
source include/master-slave.inc;
|
|
|
|
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;
|
|
|
|
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
|
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
|
|
|
|
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
|
|
insert into t3 select * from t2;
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
select * from t1;
|
|
select * from t3;
|
|
|
|
connection master;
|
|
|
|
drop table t1;
|
|
drop table t2;
|
|
drop table t3;
|
|
create table t1(a int, b int, unique(b));
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
insert into t1 values(1,10);
|
|
|
|
connection master;
|
|
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
|
|
|
|
save_master_pos;
|
|
connection slave;
|
|
# don't sync_with_master because the slave SQL thread should be stopped because
|
|
# of the error so MASTER_POS_WAIT() will not return; just sleep and hope the
|
|
# slave SQL thread will have had time to stop.
|
|
|
|
sleep 1;
|
|
show status like 'slave_running';
|