From: michael at kofler dot cc
Operating system: linux (suse 9.1)
PHP version: 5CVS-2004-11-01 (dev)
PHP Bug Type: MySQLi related
Bug description: getting rowset from a stored procedure, with/without
mysqli_realconnect
Description:
------------
I am using MySQL 5.0.1 (snapshot) and PHP 5.0.2 with mysqli interface
(latest snapshot) under Linux (SUSE 9.1).
I use $mysqli->multi_query to call a SP. I want to get back the SELECT
results of the SP.
With a normal connect ($mysqli = new mysqli($mysqlhost, $mysqluser,
$mysqlpasswd, $mysqldb)), I don't get results.
However, if I instead use $mysqli = mysqli_init + $mysqli->real_connect()
with the very same parameters, everything works fine (many thanks to Gleb
Paharenko for this tip).
Reproduce code:
---------------
This is my SP:
CREATE PROCEDURE `test`()
BEGIN
SELECT * FROM t1;
END
And this it the PHP code
$ok = $mysqli->multi_query("CALL test()");
if($ok) {
echo "<p>OK</p>\n";
do {
echo "<p>result</p>\n";
$result = $mysqli->store_result();
if($result) {
show_table($result); // shows result details
$result->close();
}
} while($mysqli->next_result());
}
Expected result:
----------------
With $mysqli->real_connect, the code above works fine.
Actual result:
--------------
With a normal connect ($mysqli = new mysqli(...)), $ok is always false.
--
Edit bug report at http://bugs.php.net/?id=30645&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30645&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30645&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30645&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30645&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30645&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30645&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30645&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30645&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30645&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30645&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30645&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30645&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30645&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30645&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30645&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30645&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30645&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30645&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30645&r=mysqlcfg