php.net |  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: 2014-01-01 12:35 UTC
Votes:27
Avg. Score:4.7 ± 0.7
Reproduced:24 of 24 (100.0%)
Same Version:11 (45.8%)
Same OS:9 (37.5%)
From: phpbugs2012 at joern dot heissler dot de Assigned: mysql
Status: Assigned Package: PDO MySQL
PHP Version: master-Git-2012-08-22 (Git) OS:
Private report: No CVE-ID:
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: phpbugs2012 at joern dot heissler dot de
New email:
PHP Version: OS:

 

 [2012-08-22 10:14 UTC] phpbugs2012 at joern dot heissler dot de
Description:
------------
#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:
#if defined(MYSQL_OPT_LOCAL_INFILE) || defined(PDO_USE_MYSQLND)

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>
int opt = MYSQL_OPT_LOCAL_INFILE;

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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-10-25 10:48 UTC] uw@php.net
-Assigned To: +Assigned To: mysql
 [2014-01-01 12:35 UTC] felipe@php.net
-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:
[client]
local-infile = 1
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Fri Jul 28 18:01:37 2017 UTC