From: andreas dot streichardt at globalpark dot com Operating system: Linux PHP version: 5.3.0 PHP Bug Type: MySQLi related Bug description: mysqli_options doesn't work when using mysqlnd
Description: ------------ mysqli_real_connect() doesn't honor init commands previously set with mysqli_options($x,MYSQLI_INIT_COMMAND) when using the mysqlnd driver. I am not sure if this is simply a missing feature or a bug. At least this is a documentation problem as it isn't noted anywhere. Ideally if this is not a bug mysqli_options should return false so one notices that it isn't supported yet. This problem only appears when using mysqlnd as the driver. mysql> SELECT version(); +----------------+ | version() | +----------------+ | 5.4.1-beta-log | +----------------+ But i don't think this is related to the database version, is it? Reproduce code: --------------- $handle=mysqli_init(); if (!mysqli_options($handle,MYSQLI_INIT_COMMAND,"testtest")) print "Broken!\n"; if (!...@mysqli_real_connect($handle,"localhost","root","","test",3306)) print "Connection broken!\n"; Expected result: ---------------- Connection broken! (testtest is not a valid query) If the general log is activated you should see the query in the log Actual result: -------------- blank output (database connection was successful - assuming that the credentials provided in the connection string work). no "testtest" query in the general log -- Edit bug report at http://bugs.php.net/?id=49029&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49029&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49029&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49029&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49029&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49029&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49029&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49029&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49029&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49029&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49029&r=support Expected behavior: http://bugs.php.net/fix.php?id=49029&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49029&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49029&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49029&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49029&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49029&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49029&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49029&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49029&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49029&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49029&r=mysqlcfg