php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52623 PDO::MYSQL_ATTR_MAX_BUFFER_SIZE not supported in mysqlnd
Submitted: 2010-08-17 12:17 UTC Modified: 2010-08-20 13:04 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:3 of 4 (75.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: gasper dot kozak at gmail dot com Assigned:
Status: Wont fix Package: MySQL related
PHP Version: 5.3SVN-2010-08-17 (SVN) OS: any
Private report: No CVE-ID: None
 [2010-08-17 12:17 UTC] gasper dot kozak at gmail dot com
Description:
------------
Seems as if mysqlnd driver doesn't support PDO::MYSQL_ATTR_MAX_BUFFER_SIZE 
constant.

In pdo_mysql.c (from svn 
http://svn.php.net/repository/php/php-
src/branches/PHP_5_3/ext/pdo_mysql/pdo_mysql.c), I can see:

#ifndef PDO_USE_MYSQLND
	REGISTER_PDO_CLASS_CONST_LONG("MYSQL_ATTR_MAX_BUFFER_SIZE", 
(long)PDO_MYSQL_ATTR_MAX_BUFFER_SIZE);
...
#endif

So, this constant (and some others) are only defined when mysqlnd isn't the 
active driver.

Test script:
---------------
echo PDO::MYSQL_ATTR_MAX_BUFFER_SIZE;

Expected result:
----------------
Output 1005

Actual result:
--------------
Fatal error: Undefined class constant 'MYSQL_ATTR_MAX_BUFFER_SIZE' in php shell 
code on line 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-20 12:21 UTC] andrey@php.net
-Status: Open +Status: Wont fix
 [2010-08-20 12:21 UTC] andrey@php.net
This constant is not defined when mysqlnd is enabled because it makes no sense for mysqlnd. mysqlnd allocates buffers for the data as big as needed. With libmysql PDO_MYSQL needs to allocate some buffer and hope that the data will fit in.
 [2010-08-20 13:04 UTC] gasper dot kozak at gmail dot com
I understand, the constant has no effect on how mysqlnd behaves. Wouldn't it then 
be better to just enable the constant, for cross-platform compatibility reasons? 
Currently users have to explicitly check for the constant and pass different 
options, if it's needed on mysql/mysqli.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 11:01:30 2024 UTC