diff options
author | guilhem@mysql.com <> | 2004-01-20 15:41:22 -0500 |
---|---|---|
committer | guilhem@mysql.com <> | 2004-01-20 15:41:22 -0500 |
commit | 0c55118883309fe6ebf0fe016222c3c1b7c177d9 (patch) | |
tree | dc0e356519e7d9db406a8c5b63dc78128161d590 /sql/slave.cc | |
parent | 56e8554aac6528f3bec4d8d866faa9728acdb90a (diff) | |
download | mariadb-git-0c55118883309fe6ebf0fe016222c3c1b7c177d9.tar.gz |
Fix for BUG#2452 "Empty LOAD DATA INFILE failes with the master in 3.23.x":
do not write the Execute_load_log_event if there was no Create_file_log_event
(empty file).
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 116d602b238..d6510b26271 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2840,6 +2840,14 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev) if (unlikely(!num_bytes)) /* eof */ { send_ok(net); /* 3.23 master wants it */ + /* + If we wrote Create_file_log_event, then we need to write + Execute_load_log_event. If we did not write Create_file_log_event, + then this is an empty file and we can just do as if the LOAD DATA + INFILE had not existed, i.e. write nothing. + */ + if (unlikely(cev_not_written)) + break; Execute_load_log_event xev(thd,0,0); xev.log_pos = mi->master_log_pos; if (unlikely(mi->rli.relay_log.append(&xev))) |