|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54656 mysqlnd_ms_get_stats resets counter if refresh of page is frantic
Submitted: 2011-05-04 12:53 UTC Modified: 2011-05-04 15:30 UTC
From: sathia dot musso at gmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.3.6 OS: debian
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: sathia dot musso at gmail dot com
New email:
PHP Version: OS:


 [2011-05-04 12:53 UTC] sathia dot musso at gmail dot com
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:


	$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


Expected result:
i'd expect counters to grow anyway.

Actual result:
counters are reset to zero randomly


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-04 15:30 UTC]
-Status: Open +Status: Bogus
 [2011-05-04 15:30 UTC]
I assume you're hitting different Apache processes randomly on your machine. Each instance has it's own individual statistics.

Please also mind to report bugs for pecl extensions on
 [2011-05-04 19:30 UTC] sathia dot musso at gmail dot com
not sure why it should work like that. but i understand what you say. thanks
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 21:03:37 2023 UTC