Bug #18669 Session COM_STATISTICS breaks mysqladmin status
Submitted: 30 Mar 2006 22:22 Modified: 31 May 2006 1:18
Reporter: Kolbe Kegel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0,5.1 OS:Linux (Linux)
Assigned to: Iggy Galarza CPU Architecture:Any

[30 Mar 2006 22:22] Kolbe Kegel
Description:
COM_STATISTICS was changed in 5.0 to show session statistics instead of global statistics as it had done in previous versions.

This change has the effect of making "mysqladmin status" show essentially useless information, specifically as related to "Slow queries" and "Opens".

Presumably, mysqladmin will always report 0 for both of these values, as getting status information with mysqladmin will never itself trigger a Slow query or Open.

How to repeat:
Execute several slow queries in both 4.1 and 5.0 and use "mysqladmin status" to see server status information.

From 5.0.20-bk:

Uptime: 899  Threads: 2  Questions: 79  Slow queries: 0  Opens: 0  Flush tables: 1  Open tables: 11  Queries per second avg: 0.088

From 4.1.18:

Uptime: 773  Threads: 1  Questions: 52  Slow queries: 2  Opens: 19  Flush tables: 1  Open tables: 11  Queries per second avg: 0.067

Suggested fix:
COM_STATISTICS should be changed in 5.1 to return GLOBAL status information rather than session information. Alternatively, some other interface could be added so that both global and session status information was available.
[22 May 2006 21:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/6739
[24 May 2006 13:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/6833
[30 May 2006 14:16] Iggy Galarza
Fixed in upcoming release 5.0.23.
[31 May 2006 1:18] Paul Dubois
Noted in 5.0.23 changelog.

The COM_STATISTICS command was changed in 5.0.3 to display session
status variable values rather than global values. This causes
mysqladmin status information not to be useful for the Slow queries
and Opens values. Now COM_STATISTICS displays the global values for
Slow queries and Opens.