Bug #54656 [NEW]: mysqlnd_ms_get_stats resets counter if refresh of page is frantic
| From: | sathia dot musso at gmail dot com | Date: | Wed, 04 May 2011 10:53:38 +0000 |
| Subject: | Bug #54656 [NEW]: mysqlnd_ms_get_stats resets counter if refresh of page is frantic | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-160531@lists.php.net to get a copy of this message | ||
From:
Operating system: debian
PHP version: 5.3.6
Package: MySQL related
Bug Type: Bug
Bug description:mysqlnd_ms_get_stats resets counter if refresh of page is frantic
Description:
------------
I've tried to access the statistics on a simple page and if I keep ctrl+r
pressed
so that it gets 30 requests/s i've noticed that the counters are reset to
0
it doesn't happen if i reload the page slowly.
Test script:
---------------
<?php
$dbuser="x";
$dbpasswd="y";
$dbname="z";
$mysqli = new mysqli("myapp", $dbuser, $dbpasswd, $db);
$GLOBALS['MYSQLI'] = $mysqli;
function my_query($mysqli, $query, $retry_count = 0) {
// print("Is \"".$query."\" Select?".
mysqlnd_ms_query_is_select($query)."<br>");
if ($retry_count > 3){
return false;
}
if (!($ret = $mysqli->query($query))) {
/* Error: 1053 SQLSTATE: 08S01 (ER_SERVER_SHUTDOWN) */
if (1053 == $mysqli->errno) {
/* ouch, slave is not available, try next... */
return my_query($mysqli, $query, ++$retry_count);
}
}
return $ret;
}
$x = my_query($mysqli, " UPDATE users SET username = 'pippo' WHERE uid =
59 "); //SELECT * FROM pippo
print("<pre>");
print_r(mysqlnd_ms_get_stats());
print("</pre>");
?>
Expected result:
----------------
i'd expect counters to grow anyway.
Actual result:
--------------
counters are reset to zero randomly
--
Edit bug report at http://bugs.php.net/bug.php?id=54656&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54656&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54656&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54656&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54656&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54656&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54656&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54656&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54656&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54656&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54656&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54656&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54656&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54656&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54656&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54656&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54656&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54656&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54656&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54656&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54656&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54656&r=mysqlcfg