Bug #27994 Expose counter for stored procedure calls in Com_% status
Submitted: 20 Apr 2007 23:18 Modified: 9 Jun 2007 18:10
Reporter: Todd Farmer (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0 OS:Any
Assigned to: Magnus Blåudd CPU Architecture:Any

[20 Apr 2007 23:18] Todd Farmer
Description:
There is no Com_% status counter that tracks invocations of stored procedures.

How to repeat:
Run script:

DROP PROCEDURE IF EXISTS counter;
CREATE PROCEDURE counter () SET @a = 1;
FLUSH STATUS;
SHOW STATUS LIKE 'Com%';
CALL counter;
SHOW STATUS LIKE 'Com%';

Note that only Com_set_option and Com_show_status have incremented.

Suggested fix:
Add counter (Com_call_procedure) and expose it in SHOW STATUS output.
[1 May 2007 20:13] Ronald Bradford
I can confirm this requirement is also needed on a client site.
[1 May 2007 23:30] Todd Farmer
Patch to expose SQLCOM_CALL as Com_call_procedure

Attachment: com_call_procedure.txt (text/plain), 903 bytes.

[2 May 2007 12:25] 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/25898

ChangeSet@1.2471, 2007-05-02 14:25:11+02:00, msvensson@pilot.blaudden +1 -0
  Bug#27994 Expose counter for stored procedure calls in Com_% status
   - Expose the already existing counter for number of stored procedure calls
[2 May 2007 12:29] Magnus Blåudd
Thanks Todd! If you have a patch for checking that all commands added to "enum_sql_command" in sql_lex.h are actually added to the status_vars array I would be very happy to take that.

Such a function would be inside a "DBUG_EXECUTE" somewhere in the server startup code only running when we debug compile - that would be so useful. ;)
[22 May 2007 17:00] Bugs System
Pushed into 5.1.19-beta
[22 May 2007 17:02] Bugs System
Pushed into 5.0.44
[9 Jun 2007 18:10] Paul DuBois
Noted in 5.0.44, 5.1.19 changelogs.

A new status variable, Com_call_procedure, indicates the number of
calls to stored procedures.