php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50384 PDO::MYSQL_ATTR_READ_DEFAULT_FILE and DEFAULT_GROUP are missing from mysqlnd
Submitted: 2009-12-04 13:00 UTC Modified: 2009-12-23 16:47 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: marques at displague dot com Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.1 OS:
Private report: No CVE-ID: None
 [2009-12-04 13:00 UTC] marques at displague dot com
Description:
------------
PDO::MYSQL_ATTR_READ_DEFAULT_FILE and  
PDO::MYSQL_ATTR_READ_DEFAULT_GROUP are not defined in the mysqlnd 
version of the pdo_mysql module.

Once defined, the functionality will need to be tested to see if it 
actually reads a mysql config file and uses the selected [group] for 
options.

Reproduce code:
---------------
echo PDO::MYSQL_ATTR_READ_DEFAULT_FILE . " " . PDO::MYSQL_ATTR_READ_DEFAULT_GROUP;

Expected result:
----------------
1003 1004

Actual result:
--------------
PHP Fatal error:  Undefined class constant 
'MYSQL_ATTR_READ_DEFAULT_FILE' in Command line code on line 1


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-04 14:47 UTC] marques at displague dot com
I just read this:
http://www.php.net/manual/en/migration53.incompatible.php

The new mysqlnd library does not read mysql configuration files 
(my.cnf/my.ini), as the older libmysql library does. If your code 
relies on settings in the configuration file, you can load it 
explicitly with the mysqli_options() function.

Ugh.  There is no mysqli_options equivalent for PDO_mysql.  Should 
check that the class constant exists, and follow two different paths 
based on that?
 [2009-12-23 16:47 UTC] svn@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=292551
Log: Fixed bug #50384 (PDO::MYSQL_ATTR_READ_DEFAULT_FILE and DEFAULT_GROUP are missing from mysqlnd)
 [2009-12-23 16:47 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.

Since the only way to obtain this kind of functionality in PDO_mysql would be to use these constants, then you should find an alternative method and check if the constants is defined.
 [2020-02-07 06:09 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=a1e623745d6037472b773c3a237d0eb9cf6eb253
Log: Fixed bug #50384 (PDO::MYSQL_ATTR_READ_DEFAULT_FILE and DEFAULT_GROUP are missing from mysqlnd)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 16 22:00:01 2025 UTC