Bug #39791 MySQL needs a SHOW PREPARED STATEMENTS report
Submitted: 1 Oct 2008 20:40 Modified: 2 Oct 2008 13:18
Reporter: Shawn Green Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Information schema Severity:S4 (Feature request)
Version:5.0 and higher OS:Any
Assigned to: CPU Architecture:Any

[1 Oct 2008 20:40] Shawn Green
Description:
Not all code written to work with MySQL will function properly during its initial runs. As a means of tracking which connections are accumulating prepared statements that have not been reclaimed, I suggest we implement a SHOW PREPARED STATEMENTS report. 

This report will list, for all connections, every prepared statement on that connection. The columns could include:

* The session number
* the full user@hostname credentials in use on the session
* the prepared statement's text
* the size of the prepared statement (in memory)
* the number of times the statement had been used so far. 

This would be useful not only in debugging client code but in tracking down memory leaks related to PREPARED but not CLOSEd prepared statements. 

How to repeat:
n/a

Suggested fix:
Expose more information about prepared statements in a report similar to the one I just described.
[2 Oct 2008 13:18] Valeriy Kravchuk
Thank you for a reasonable feature request.
[2 Oct 2008 13:48] MySQL Verification Team
I concur. Adding a new, queriable table/view to INFORMATION_SCHEMA (or any other similar system information source) would be the more flexible and forward-thinking solution.