Bug #62889 [Opn->Ver]: LOAD DATA INFILE broken
| From: | cmb@php.net | Date: | Sun, 05 Jan 2020 13:10:21 +0000 |
| Subject: | Bug #62889 [Opn->Ver]: LOAD DATA INFILE broken | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-224712@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=62889&edit=1
ID: 62889
Updated by: cmb@php.net
Reported by: phpbugs2012 at joern dot heissler dot de
Summary: LOAD DATA INFILE broken
-Status: Open
+Status: Verified
Type: Bug
Package: PDO MySQL
PHP Version: master-Git-2012-08-22 (Git)
Block user comment: N
Private report: N
New Comment:
> MYSQL_OPT_LOCAL_INFILE is not a macro. It's an enum.
That[1].
This issue has been resolved for mysqlnd by fixing bug #54158, but
still persists for libmysql-client.
[1] <https://github.com/mysql/mysql-server/blob/91a17cedb1ee880fe7915fb14cfd74c04e8d6588/include/mysql.h#L178>
Previous Comments:
------------------------------------------------------------------------
[2015-02-03 20:11:02] 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
------------------------------------------------------------------------
[2012-08-22 10:14:45] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=62889&edit=1