Bug #37161 mysqlbinlog doesn't escape backslashes in paths when replacing LOAD DATA INFILE

Submitted: 3 Jun 2008 14:30 Modified: 24 Oct 2008 2:42
Reporter: Rico H. Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.51a OS:Windows (XP)
Assigned to: Tatiana Azundris Nuernberg CPU Architecture:Any

[3 Jun 2008 14:30] Rico H.
Description:
mysqlbinlog doesn't escape backslashes in file paths when replacing LOAD DATA INFILE by LOAD DATA LOCAL INFILE. The problem occurs when mysqlbinlog is used on Windows. mysqlbinlog will output the following sentence:

LOAD DATA LOCAL INFILE 'c:\tmp\SQL_LOAD_MB-1-0' INTO TABLE tests FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';

MySQL will generate a file not found error (Errcode: 22) when we try to execute the previous query.
Instead, if we escape the backslashes of the file path, the query is executed successfully. Below is the right query:

LOAD DATA LOCAL INFILE 'c:\\tmp\\SQL_LOAD_MB-1-0' INTO TABLE tests FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n';

In my case, I'm trying to load the binlogs generated from a Linux box into a Windows box. I'm using mysqlbinlog on the Windows box with the files that the Linux box generates.

How to repeat:
Issue a LOAD DATA INFILE on the master, so that you can use mysqlbinlog to analize the output. In my case, the master is a Linux, but I'm running mysqlbinlog on Windows.
[3 Aug 2008 18:48] Sveta Smirnova
Thank you for the report.

Verified as described.
[24 Oct 2008 2:42] Tatiana Azundris Nuernberg
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.040 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.