|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62889 LOAD DATA INFILE broken
Submitted: 2012-08-22 10:14 UTC Modified: 2020-01-05 13:10 UTC
Avg. Score:4.5 ± 0.8
Reproduced:28 of 28 (100.0%)
Same Version:11 (39.3%)
Same OS:9 (32.1%)
From: phpbugs2012 at joern dot heissler dot de Assigned:
Status: Closed Package: PDO MySQL
PHP Version: master-Git-2012-08-22 (Git) OS:
Private report: No CVE-ID: None
 [2012-08-22 10:14 UTC] phpbugs2012 at joern dot heissler dot de
#46964 introduced a new bug. The patch there to fix compilation issues actually breaks the feature.

ext/pdo_mysql/mysql_driver.c has this line:

MYSQL_OPT_LOCAL_INFILE is not a macro. It's an enum.
The defined() will always be false and the block will not be compiled.

One way to fix this is to add a configure check which compiles a program like this:
#include <mysql/mysql.h>

When it cannot be compiled, the enum isn't defined. Then define some macro or so which can be checked by the preprocessor.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-25 10:48 UTC]
-Assigned To: +Assigned To: mysql
 [2014-01-01 12:35 UTC]
-Package: PDO related +Package: PDO MySQL
 [2015-02-03 20:11 UTC] phpbugs2012 at joern dot heissler dot de
Work around for the problem:
* add to options array: PDO::MYSQL_ATTR_READ_DEFAULT_GROUP => 'client'
* add to /etc/mysql/my.cnf:
local-infile = 1
 [2017-10-24 08:07 UTC]
-Status: Assigned +Status: Open -Assigned To: mysql +Assigned To:
 [2020-01-05 13:10 UTC]
-Status: Open +Status: Verified
 [2020-01-05 13:10 UTC]
> MYSQL_OPT_LOCAL_INFILE is not a macro. It's an enum.


This issue has been resolved for mysqlnd by fixing bug #54158, but
still persists for libmysql-client.

[1] <>
 [2020-12-11 10:26 UTC]
Automatic comment on behalf of
Log: Fixed bug #62889
 [2020-12-11 10:26 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC