ID:               35203
 User updated by:  kristaps dot kaupe at itrisinajumi dot lv
 Reported By:      kristaps dot kaupe at itrisinajumi dot lv
 Status:           Open
 Bug Type:         MySQLi related
 Operating System: Gentoo Linux
 PHP Version:      5.0.5
 New Comment:

Additional thing - when you don't send any requests to Apache and MySQL
for some time, sample script seems to work. But just for one request,
when you press "Refresh" in your browser and run it second time, it
gives output i've posted.


Previous Comments:
------------------------------------------------------------------------

[2005-11-12 22:27:09] kristaps dot kaupe at itrisinajumi dot lv

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 this bug report at http://bugs.php.net/?id=35203&edit=1

Reply via email to