From: kristaps dot kaupe at itrisinajumi dot lv
Operating system: Gentoo Linux
PHP version: 5.0.5
PHP Bug Type: MySQLi related
Bug description: Unable to call multiple stored procedures with single mysql
connection
Description:
------------
Create MySQL test table and procedure:
--------------------------------------
CREATE TABLE `test_table` (
`id` int(10) unsigned NOT NULL auto_increment,
`txt` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO test_table (txt) VALUES ('test1');
CREATE PROCEDURE `test_proc`(IN p_id INT(10) UNSIGNED) READS SQL DATA
DETERMINISTIC
BEGIN
SELECT * FROM test_table WHERE id = p_id;
END
Reproduce code:
---------------
// $db is mysqli object
if ($result = $db->query('CALL test_proc(1);')) {
$res = $result->fetch_assoc();
print_r($res);
$result->close();
}
else
echo '<br />'.$db->error.'<br />';
if ($result = $db->query('CALL test_proc(1);')) {
$res = $result->fetch_assoc();
print_r($res);
$result->close();
}
else
echo '<br />'.$db->error.'<br />';
Expected result:
----------------
Array
(
[id] => 1
[txt] => test1
)
Array
(
[id] => 1
[txt] => test1
)
Actual result:
--------------
Array
(
[id] => 1
[txt] => test1
)
Lost connection to MySQL server during query
--
Edit bug report at http://bugs.php.net/?id=35203&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=35203&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=35203&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=35203&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=35203&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=35203&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=35203&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=35203&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=35203&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=35203&r=support
Expected behavior: http://bugs.php.net/fix.php?id=35203&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=35203&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=35203&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=35203&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35203&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=35203&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=35203&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=35203&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=35203&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=35203&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=35203&r=mysqlcfg