From: dayseye at 21cn dot com Operating system: WinXP PHP version: 5.2.8 PHP Bug Type: MySQLi related Bug description: mysqli_multi_query affect next query
Description: ------------ first, execute mysqli_multi_query() with some INSERT some rows in a table; then ,execute mysqli_query() to insert a row into ANOHTER; execute mysqli_insert_id($link) get the newly inserted id, will return the first inserted id that from the firts mysqli_multi_query(). and the mysqli_query() is failed to insert data. Reproduce code: --------------- mysqli_multi_query($link, "INSERT INTO `a` VALUES (NULL, 'Y'); INSERT INTO `a` VALUES (NULL, 'Y')"); //should return new id 31, 32 mysqli_query($link, "INSERT INTO `b` VALUES (NULL, 11, 'hello')"); //should return new id 12; echo mysqli_insert_id($link); Expected result: ---------------- 12 Actual result: -------------- 31 -- Edit bug report at http://bugs.php.net/?id=46829&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46829&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46829&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46829&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46829&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46829&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46829&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46829&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46829&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46829&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46829&r=support Expected behavior: http://bugs.php.net/fix.php?id=46829&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46829&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46829&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46829&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46829&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46829&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46829&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46829&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46829&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46829&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46829&r=mysqlcfg