Bug #52561 [NEW]: function mysqli_ping no attempted reconnection!

From: Date: Sat, 07 Aug 2010 11:32:27 +0000
Subject: Bug #52561 [NEW]: function mysqli_ping no attempted reconnection!
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-153212@lists.php.net to get a copy of this message
From:             
Operating system: irrelevant
PHP version:      5.3.3
Package:          MySQL related
Bug Type:         Bug
Bug description:function mysqli_ping no attempted reconnection!

Description:
------------
I use mysqli_ping reconnection database when php script long time run.
when my use mysqlnd module, mysqli_ping() is run fail, errormsg is "MySQL
server has gone away".

mysqli.reconnect setting is ON. 
mysql server timeout is 30s.

Test script:
---------------
<?php
mysqli = new mysqli("localhost", "xxx", "xxx");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}
sleep(31);
/* check if server is alive */
if ($mysqli->ping()) {
    printf ("Our connection is ok!\n");
} else {
    printf ("Error: %s\n", $mysqli->error);
}

/* close connection */
$mysqli->close();
?>

Expected result:
----------------
Our connection is ok!

Actual result:
--------------
Error: MySQL server has gone away

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52561&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=52561&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=52561&r=trysnapshot53
Try a snapshot (trunk):              http://bugs.php.net/fix.php?id=52561&r=trysnapshottrunk
Fixed in SVN:                        http://bugs.php.net/fix.php?id=52561&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=52561&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=52561&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=52561&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=52561&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=52561&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=52561&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=52561&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=52561&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=52561&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=52561&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52561&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52561&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=52561&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=52561&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=52561&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=52561&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=52561&r=mysqlcfg



Thread (10 messages)

« previous php.bugs (#153212) next »