Bug #54656 [Opn->Bgs]: mysqlnd_ms_get_stats resets counter if refresh of page is frantic

From: Date: Wed, 04 May 2011 13:30:56 +0000
Subject: Bug #54656 [Opn->Bgs]: mysqlnd_ms_get_stats resets counter if refresh of page is frantic
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-160538@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54656&edit=1

 ID:                 54656
 Updated by:         johannes@php.net
 Reported by:        sathia dot musso at gmail dot com
 Summary:            mysqlnd_ms_get_stats resets counter if refresh of
                     page is frantic
-Status:             Open
+Status:             Bogus
 Type:               Bug
 Package:            MySQL related
 Operating System:   debian
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

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
http://pecl.php.net/bugs/report.php?package=mysqlnd_ms


Previous Comments:
------------------------------------------------------------------------
[2011-05-04 12:53:38] sathia dot musso at gmail dot com

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


Thread (3 messages)

« previous php.bugs (#160538) next »