Bug #2452 | Empty LOAD DATA INFILE failes with the master in 3.23.x | ||
---|---|---|---|
Submitted: | 20 Jan 2004 3:56 | Modified: | 20 Jan 2004 6:46 |
Reporter: | Masaki Fujimoto | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S3 (Non-critical) |
Version: | 4.0.17 | OS: | Linux (Debian GNU Linux (Woody)) |
Assigned to: | Guilhem Bichot | CPU Architecture: | Any |
[20 Jan 2004 3:56]
Masaki Fujimoto
[20 Jan 2004 6:44]
Guilhem Bichot
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: Thanks for this very good bug report. I just fixed the bug with this slightly different patch (we simply skip an empty file): --- 1.262/sql/slave.cc Wed Dec 17 17:29:08 2003 +++ 1.263/sql/slave.cc Tue Jan 20 15:41:20 2004 @@ -2840,6 +2840,14 @@ 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)))
[20 Jan 2004 6:46]
Guilhem Bichot
ChangeSet@1.1685.1.1, 2004-01-20 15:41:22-05:00, guilhem@mysql.com