summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_loaddata.test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-06-03 15:47:29 +0200
committerunknown <guilhem@mysql.com>2003-06-03 15:47:29 +0200
commitccb398b9eea25dab390db9a09ae80d1832bc1a8d (patch)
treea73c51b4fd36becc0396ea25c6c583d058afd7ae /mysql-test/t/rpl_loaddata.test
parent4e0e0b5b42a5f870ad13e3da4d724aa3d0f7011a (diff)
downloadmariadb-git-ccb398b9eea25dab390db9a09ae80d1832bc1a8d.tar.gz
-- Waiting for Monty's approval before push --
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' mysql-test/r/rpl_loaddata.result: result update mysql-test/t/rpl_loaddata.test: check if duplicate entries on the slave trigger an error when the slave replicates LOAD DATA INFILE (without IGNORE or REPLACE) (bug 571). sql/log_event.cc: 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'
Diffstat (limited to 'mysql-test/t/rpl_loaddata.test')
-rw-r--r--mysql-test/t/rpl_loaddata.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test
index 1f34aa9d3f9..dc4eadda192 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/t/rpl_loaddata.test
@@ -4,6 +4,9 @@
#
# 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) );
@@ -27,7 +30,21 @@ 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';