Edit report at http://bugs.php.net/bug.php?id=52529&edit=1
ID: 52529 Updated by: ka...@php.net Reported by: ben at blazely dot com Summary: PDO+Mysqlnd MYSQL_ATTR_COMPRESS undefined -Status: Open +Status: Assigned Type: Bug Package: PDO related Operating System: Ubuntu 10.04 PHP Version: 5.3SVN-2010-08-04 (snap) -Assigned To: +Assigned To: mysql Block user comment: N New Comment: Its currently known as indicated in the sources that compression is unavailable in mysqlnd Assigned to the mysql team Previous Comments: ------------------------------------------------------------------------ [2010-08-04 03:02:07] ben at blazely dot com 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 this bug report at http://bugs.php.net/bug.php?id=52529&edit=1