From:             develar at gmail dot com
Operating system: Windows XP SP2
PHP version:      5.2.0
PHP Bug Type:     PDO related
Bug description:  Lost connection to MySQL server during query by a repeated 
call stored proced

Description:
------------
The second call stored procedures causes an error "SQLSTATE[HY000]:
General error: 2013 Lost connection to MySQL server during query" with
probability of 50%. I read #35333 #35637 #35203, but why the given code
fine works in Debian?

Reproduce code:
---------------
CREATE PROCEDURE `foo`()
    NOT DETERMINISTIC
    CONTAINS SQL
    SQL SECURITY DEFINER
    COMMENT ''
BEGIN
     SELECT 2 * 2;
END;

<?php

$Db = new PDO('mysql:host=localhost;dbname=test', 'root', '',
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'",
PDO::ATTR_PERSISTENT => true));
$Db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
$Db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);

$Pdo = $Db->prepare('CALL foo()');
$Pdo->execute();
print_r($Pdo->fetchAll());

$Pdo = $Db->prepare('CALL foo()');
$Pdo->execute();
print_r($Pdo->fetchAll());
$Pdo->closeCursor();

?>

Expected result:
----------------
Array
(
    [0] => Array
        (
            [2 * 2] => 4
        )

)
Array
(
    [0] => Array
        (
            [2 * 2] => 4
        )

)


Actual result:
--------------
Array
(
    [0] => Array
        (
            [2 * 2] => 4
        )

)
<br />
<b>Warning</b>:  PDOStatement::execute() [<a
href='function.PDOStatement-execute'>function.PDOStatement-execute</a>]:
SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server
during query in <b>C:\home\test\www\pdo.php</b> on line <b>12</b><br />
Array
(
)

-- 
Edit bug report at http://bugs.php.net/?id=39858&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39858&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39858&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39858&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39858&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39858&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39858&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39858&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39858&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39858&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39858&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39858&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39858&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39858&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39858&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39858&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39858&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39858&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39858&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39858&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39858&r=mysqlcfg

Reply via email to