Bug #33975 replay load data binlog event failed on windows
Submitted: 22 Jan 2008 9:09 Modified: 20 Feb 2008 2:40
Reporter: Zhenxing He Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1.23 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any
Tags: binlog, replication, windows

[22 Jan 2008 9:09] Zhenxing He
Description:
When a load data statement in a binlog file is replayed on windows, it will fail with error that says:
ERROR 2 (HY000) at line 37: File 'c:DOCUME~1SSHD_S~1LOCALS~1TempSQL_LOAD_MB-1-0' not found (Errcode: 2)

How to repeat:
run the following test case on a Windows box:

-- source include/have_log_bin.inc
reset master;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (word varchar(20));
load data infile '../std_data_ln/words.dat' into table t1;
flush logs;
--exec $MYSQL_BINLOG $MYSQLTEST_VARDIR/log/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/binlog_start_comment.binlog

And the load data statement in the binlog would be like:

load data LOCAL INFILE 'c:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\SQL_LOAD_MB-1-0'

The path in this line is not correctly recognized and result in failure.

Suggested fix:
Properly quote the '\' character when output the path
[20 Feb 2008 2:40] Zhenxing He
Dup of BUG#34355