summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/rpl_loaddata.result13
-rw-r--r--mysql-test/std_data/rpl_loaddata2.dat2
-rw-r--r--mysql-test/t/rpl_loaddata.test15
3 files changed, 28 insertions, 2 deletions
diff --git a/mysql-test/r/rpl_loaddata.result b/mysql-test/r/rpl_loaddata.result
index 0302381c119..8b910d0d183 100644
--- a/mysql-test/r/rpl_loaddata.result
+++ b/mysql-test/r/rpl_loaddata.result
@@ -19,7 +19,7 @@ select * from t3;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
-2003-04-22 2416 a bbbbb
+2003-03-22 2416 a bbbbb
show master status;
File Position Binlog_do_db Binlog_ignore_db
slave-bin.001 964
@@ -55,3 +55,14 @@ reset slave;
show slave status;
Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
127.0.0.1 root MASTER_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 4
+reset master;
+create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
+unique(day));
+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;
+Duplicate entry '2003-03-22' for key 1
+show master status;
+File Position Binlog_do_db Binlog_ignore_db
+master-bin.001 491
+drop table t2;
diff --git a/mysql-test/std_data/rpl_loaddata2.dat b/mysql-test/std_data/rpl_loaddata2.dat
index b883d9dcd58..04d84f1f45e 100644
--- a/mysql-test/std_data/rpl_loaddata2.dat
+++ b/mysql-test/std_data/rpl_loaddata2.dat
@@ -4,5 +4,5 @@
##
>2003-03-22,2161,%c%,%asdf%
##
->2003-04-22,2416,%a%,%bbbbb%
+>2003-03-22,2416,%a%,%bbbbb%
##
diff --git a/mysql-test/t/rpl_loaddata.test b/mysql-test/t/rpl_loaddata.test
index 4c4ff6a093e..a3bb8c9aec9 100644
--- a/mysql-test/t/rpl_loaddata.test
+++ b/mysql-test/t/rpl_loaddata.test
@@ -112,3 +112,18 @@ stop slave;
reset slave;
--replace_result $MASTER_MYPORT MASTER_PORT
show slave status;
+
+# Finally, see if logging is done ok on master for a failing LOAD DATA INFILE
+
+connection master;
+reset master;
+create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
+unique(day));
+--error 1062;
+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;
+# To test that there is Create_file & Delete_file, we test if the binlog is as
+# long as expected (can't do SHOW BINLOG EVENTS because of varying file_id).
+show master status;
+drop table t2;