Edit report at http://bugs.php.net/bug.php?id=52623&edit=1
ID: 52623
User updated by: gasper dot kozak at gmail dot com
Reported by: gasper dot kozak at gmail dot com
Summary: PDO::MYSQL_ATTR_MAX_BUFFER_SIZE not supported in
mysqlnd
Status: Wont fix
Type: Feature/Change Request
Package: MySQL related
Operating System: any
PHP Version: 5.3SVN-2010-08-17 (SVN)
Block user comment: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2010-08-20 12:21:39] [email protected]
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-17 12:17:53] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=52623&edit=1