From: shooreek at gmail dot com Operating system: WinXP SP3 PHP version: 5.3.0 PHP Bug Type: MySQLi related Bug description: MySQLi client compression broken
Description: ------------ It seems like mysqli do not understand compression protocol. When you are using flag MYSQLI_CLIENT_COMPRESS in mysqli_real_connect - it connects, but can't properly handle server (compressed?) answer. MySQL server 5.0.67-community-nt-log with compression enabled: mysql> show variables like '%have_comp%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | have_compress | YES | +---------------+-------+ 1 row in set (0.00 sec) I can connect to MySQL server using command line client with flag '-C' (use compression): C:\Documents and Settings\U>mysql -C Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 14 Server version: 5.0.67-community-nt-log MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show status like '%compr%'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | Compression | ON | +---------------+-------+ 1 row in set (0.00 sec) mysql> I think that something is wrong with mysqli and flag MYSQLI_CLIENT_COMPRESS Reproduce code: --------------- $mysqli = mysqli_init(); if (!$mysqli) { die('mysqli_init failed'); } if (!$mysqli->real_connect('localhost', '', '', NULL, NULL, NULL, MYSQLI_CLIENT_COMPRESS)) { die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); } $mysqli->query("show status like '%compre%'"); $mysqli->close(); Expected result: ---------------- Normal query execution without any errors. Actual result: -------------- PHP Some times it crushes. Sometimes it do not. Error log: PHP Warning: mysqli::query(): MySQL server has gone away in C:\Documents and Settings\U\Desktop\compress_test.php on line 42 PHP Warning: mysqli::query(): Error reading result set's header in C:\Documents and Settings\U\Desktop\compress_test.php on line 42 MySQL Error log: 090818 17:36:04 [Warning] Aborted connection 8 to db: 'unconnected' user: 'U' host: 'localhost' (Got a packet bigger than 'max_allowed_packet' bytes) someimes: 090818 17:31:13 [Warning] Aborted connection 61 to db: 'unconnected' user: 'U' host: 'localhost' (Got an error reading communication packets) -- Edit bug report at http://bugs.php.net/?id=49287&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49287&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49287&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49287&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49287&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49287&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49287&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49287&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49287&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49287&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49287&r=support Expected behavior: http://bugs.php.net/fix.php?id=49287&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49287&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49287&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49287&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49287&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49287&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49287&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49287&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49287&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49287&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49287&r=mysqlcfg