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:4
Avg. Score:4.2 ± 0.8
Reproduced:3 of 3 (100.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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
10 - 3 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Tue Nov 30 13:03:49 2021 UTC