Bug->Doc #51960 [Opn]: PDO::MYSQL_ATTR_LOCAL_INFILE cause error always
| From: | walkinraven at gmail dot com | Date: | Wed, 02 Jun 2010 05:38:34 +0000 |
| Subject: | Bug->Doc #51960 [Opn]: PDO::MYSQL_ATTR_LOCAL_INFILE cause error always | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-4484@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51960&edit=1
ID: 51960
User updated by: walkinraven at gmail dot com
Reported by: walkinraven at gmail dot com
Summary: PDO::MYSQL_ATTR_LOCAL_INFILE cause error always
Status: Open
-Type: Bug
+Type: Documentation Problem
Package: PDO related
Operating System: Ubuntu 8.04
PHP Version: 5.2SVN-2010-06-01 (SVN)
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2010-06-02 07:35:32] 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 05:42:27] 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 00:33:23] 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-01 05:27:00] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=51960&edit=1