| Bug #24390 | Com_stmt_close doesn't increment when prepare failed, but Com_stmt_prepare does | ||
|---|---|---|---|
| Submitted: | 17 Nov 2006 11:44 | Modified: | 30 Nov 2006 20:43 | 
| Reporter: | Shane Bester (Platinum Quality Contributor) | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: C API (client library) | Severity: | S3 (Non-critical) | 
| Version: | 5.0.30,5.1.13,4.1.23 | OS: | Any (*) | 
| Assigned to: | CPU Architecture: | Any | |
| Tags: | Com_stmt_close, Com_stmt_prepare | ||
   [17 Nov 2006 11:44]
   Shane Bester        
  
 
   [17 Nov 2006 11:44]
   MySQL Verification Team        
  testcase
Attachment: prepare.c (text/x-csrc), 1.41 KiB.
   [30 Nov 2006 20:43]
   Konstantin Osipov        
  Shane, mysql_stmt_close is not necessarily a server call. Imagine the following C API sequnce: stmt= mysql_stmt_init(mysql); mysql_stmt_close(stmt); In this case, all operations are local and Com_stmt_close is not incremented (the server doesn't even know you allocated a handle and then closed it). In this case: stmt= mysql_stmt_init(mysql); mysql_stmt_prepare(stmt); // there is an error, so there is no statement // handle on the server side, and the client library notices that mysql_stmt_close(stmt); There is also no server call.

