php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51960 PDO::MYSQL_ATTR_LOCAL_INFILE cause error always
Submitted: 2010-06-01 05:27 UTC Modified: 2010-10-23 14:50 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: walkinraven at gmail dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2SVN-2010-06-01 (SVN) OS: Ubuntu 8.04
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: walkinraven at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-01 05:27 UTC] walkinraven at gmail dot com
Description:
------------
If you set PDO::MYSQL_ATTR_LOCAL_INFILE with PDO::setAttribute function, it will return FALSE, whatever you set it to TRUE or FALSE.

Test script:
---------------
// $pdo=new PDO(...);
$result=$pdo->setAttribute(PDO::MYSQL_ATTR_LOCAL_INFILE, FALSE);

// or you could try set it to TRUE, you will get the same. $result=FALSE

Expected result:
----------------
$result != FALSE

Actual result:
--------------
$result == FALSE

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-02 00:33 UTC] rgagnon24 at gmail dot com
Looking in ext/pdo/mysql_driver.c, there is no support within get_attribute() nor set_attribute() for this attribute.

This is why you always get false back.  Its just not doing anything.  We were running into just this same thing ourselves today in fact.
 [2010-06-02 05:42 UTC] rgagnon24 at gmail dot com
A correction to my comment above after reviewing the source code more.

The attribute PDO::MYSQL_ATTR_LOCAL_INFILE is supported by PDO, but only during the initial creation of the PDO object.  You must set PDO::MYSQL_ATTR_LOCAL_INFILE in your options array.

That means this is not a bug.
 [2010-06-02 07:35 UTC] walkinraven at gmail dot com
Thank you!

For there is no notice about this problem in user's manual ( http://www.php.net/manual/en/ref.pdo-mysql.php ), I have changed this into a problem of documentation.

PDO::MYSQL_ATTR_LOCAL_INFILE can be set only at object initialization.
 [2010-06-02 07:38 UTC] walkinraven at gmail dot com
-Type: Bug +Type: Documentation Problem
 [2010-06-02 07:38 UTC] walkinraven at gmail dot com
Thank you!

For there is no notice about this problem in user's manual ( http://www.php.net/manual/en/ref.pdo-mysql.php ), I have changed this into a problem of documentation.

PDO::MYSQL_ATTR_LOCAL_INFILE can be set only at object initialization.
 [2010-10-22 15:45 UTC] kalle@php.net
-Package: PDO related +Package: Documentation problem
 [2010-10-23 14:50 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304657
Log: Fixed bug #51960 (#51960 PDO::MYSQL_ATTR_LOCAL_INFILE cause error always)

# Also fixed this for PDO::MYSQL_ATTR_INIT_COMMAND
 [2010-10-23 14:50 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-10-23 14:50 UTC] kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=dbb1dd6cfe6fa409b5d10fc6bf23672f551e9fea
Log: Fixed bug #51960 (#51960 PDO::MYSQL_ATTR_LOCAL_INFILE cause error always)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Sep 01 02:00:02 2025 UTC