Bug #23159 prepared_stmt_count should be status variable
Submitted: 10 Oct 2006 23:19 Modified: 24 Jan 2007 0:16
Reporter: Kolbe Kegel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1,5.0,5.1 OS:Linux (Linux)
Assigned to: Tomash Brechko

[10 Oct 2006 23:19] Kolbe Kegel
Description:
The prepared_stmt_count system variable should in fact be a status variable.

The documentation says:

# prepared_stmt_count

The current number of prepared statements. (The maximum number of statements is given by the max_prepared_stmt_count system variable.) This variable was added in MySQL 5.0.21.

This is obviously not something that can be set in a configuration file or changed directly at runtime, and it *is* something that is meant to reflect the current status of some internal facility or process.

How to repeat:
n/a

Suggested fix:
Such an item belongs as a status variable instead of a system variable.

If this was done so that @@prepared_stmt_count could be used, that is poor rationale for implementing something so obviously out of place... this information should simply be made available in INFORMATION_SCHEMA.
[20 Nov 2006 14:18] 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/15556

ChangeSet@1.2551, 2006-11-20 17:15:40+03:00, kroki@moonlight.intranet +4 -0
  BUG#23159: prepared_stmt_count should be status variable
  
  Make Prepared_stmt_count a global status variable, accessible via
  SHOW STATUS LIKE 'Prepared_stmt_count';.  Documentation should be
  updated.
[21 Nov 2006 13:16] Konstantin Osipov
A code review sent by email.
[21 Nov 2006 13:52] 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/15639

ChangeSet@1.2551, 2006-11-21 16:49:18+03:00, kroki@moonlight.intranet +4 -0
  BUG#23159: prepared_stmt_count should be status variable
  
  Make Prepared_stmt_count a global status variable, accessible via
  SHOW STATUS LIKE 'Prepared_stmt_count';.  Documentation should be
  updated.
[21 Nov 2006 16:32] Tomash Brechko
Queued to 4.1-runtime, 5.0-runtime, 5.1-runtime.
[30 Nov 2006 1:34] Konstantin Osipov
Pushed into 4.1.23, 5.0.32 and 5.1.13.
This is an incompatible change: prepared_stmt_count was a global server variable before this change.
[24 Jan 2007 0:16] Paul Dubois
Noted in 4.1.23, 5.0.32, 5.1.14 changelogs.  Also modified
the system variable and status variable sections accordingly.