From:
Operating system: Ubuntu 10.04
PHP version: 5.3SVN-2010-08-04 (snap)
Package: PDO related
Bug Type: Bug
Bug description:PDO+Mysqlnd MYSQL_ATTR_COMPRESS undefined
Description:
------------
Client compression support was added to mysqlnd in php 5.3.3. PDO_mysql
should now be able to use it.
However the constant MYSQL_ATTR_COMPRESS is undefined in the PDO class when
compiling using the following (bare minimum) config:
./configure --with-pdo-mysql=mysqlnd --with-mysql=mysqlnd
Due to how recent this addition is, I can find no further information on
php.net/google/anywhere...
There are also some confusing (and useless?) switches in configure for
mysqlnd compression that seem counter-intuitive.
--disable-mysqlnd-compression-support
Enable support for the MySQL compressed
protocol in mysqlnd
--with-zlib-dir[=DIR] mysqlnd: Set the path to libz install prefix
When configure runs, it says that it has disabled mysqlnd compression
support, however phpinfo() (post compile) shows that compression is
available and that pdo_mysql is using mysqlnd.
--
mysql
MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => mysqlnd 5.0.7-dev - 091210 - $Revision: 300533
--
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $
Compression => supported
SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => No
--
PDO
PDO support => enabled
PDO drivers => sqlite, sqlite2, mysql
pdo_mysql
PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.7-dev - 091210 - $Revision: 300533 $
Test script:
---------------
<?php
define("DATABASE_TYPE", 'mysql');
define("DATABASE_USERNAME", 'dbuser');
define("DATABASE_PORT", '3306');
define("DATABASE_HOST", 'db.server');
define("DATABASE_PASSWORD", 'dbpass');
define("DATABASE_DBNAME", 'dbname');
try {
$o_dbh = new PDO(
DATABASE_TYPE.":host=".DATABASE_HOST.";port=".DATABASE_PORT.";dbname=".DATABASE_DBNAME,
DATABASE_USERNAME,
DATABASE_PASSWORD,
Array(
PDO::MYSQL_ATTR_COMPRESS => true
)
);
} catch (PDOException $o_e) {
print $o_e->getMessage();
}
Expected result:
----------------
No output, DB connection established, client compression enabled.
Actual result:
--------------
Error as follows:
Fatal error: Undefined class constant 'MYSQL_ATTR_COMPRESS' in test.php on
line 15
--
Edit bug report at http://bugs.php.net/bug.php?id=52529&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52529&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52529&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=52529&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52529&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=52529&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52529&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=52529&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=52529&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=52529&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=52529&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=52529&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=52529&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=52529&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52529&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=52529&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=52529&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=52529&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=52529&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=52529&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=52529&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=52529&r=mysqlcfg