|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-07-12 19:41 UTC] prof_moriarty at veryfast dot biz
Description:
------------
Exeptionally minor bug, but a bug nonetheless.
mysql_stat, documentation says that the resulting string should be explodable into 7 elements
However in reality it can only be broken up into 6 elements.
It's broken up using double space. I've used preg_replace, and explode, and either way i only get 6 results when splitting via double space " ".
Basically, there's a missing space in the output, between the end of 'open tables', and the start of 'queries per sec'.
Shouldn't take a fraction of a sec to fix. :)
Reproduce code:
---------------
var_dump(explode(' ', mysql_stat()));
Expected result:
----------------
Array
(
[0] => Uptime: 5380
[1] => Threads: 2
[2] => Questions: 1321299
[3] => Slow queries: 0
[4] => Opens: 26
[5] => Flush tables: 1
[6] => Open tables: 17
[7] => Queries per second avg: 245.595
)
Actual result:
--------------
array(7) {
[0]=>
string(12) "Uptime: 6910"
[1]=>
string(10) "Threads: 2"
[2]=>
string(15) "Questions: 2229"
[3]=>
string(15) "Slow queries: 0"
[4]=>
string(9) "Opens: 77"
[5]=>
string(15) "Flush tables: 1"
[6]=>
string(45) "Open tables: 13 Queries per second avg: 0.323"
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 20:00:01 2025 UTC |
This line (ext/mysql/php_mysql.c:1060 or so) is where the 'magic' happens: RETURN_STRING((char *)mysql_stat(&mysql->conn), 1); This is what mysql_stat() (PHP function) returns. It's exactly the same data what the mysql_stat() (libmysqlclient C function) returns. And btw. the F in RTFM/RTFS means "friendly" :)