Bug #16143 mysql_stmt_sqlstate returns an empty string instead of '00000'
Submitted: 3 Jan 2006 0:58 Modified: 15 Feb 2006 21:26
Reporter: Eric Huss (Candidate Quality Contributor)
Status: Closed
Category:Server Severity:S3 (Non-critical)
Version:5.0.15 OS:Any (all)
Assigned to: Magnus Svensson Target Version:

[3 Jan 2006 0:58] Eric Huss
Description:
The C API function mysql_stmt_sqlstate returns an empty string (unless the state has been
changed by an error).  This function should probably return '00000' like mysql_sqlstate
does after the statement has been initialized.

How to repeat:
Call mysql_stmt_sqlstate after mysql_stmt_init.

Suggested fix:
Add:

strmov(stmt->sqlstate, not_error_sqlstate);

to mysql_stmt_init.
[15 Feb 2006 13:45] 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/2644
[15 Feb 2006 15:13] Magnus Svensson
Pushed to 5.0.19
[15 Feb 2006 21:26] Paul DuBois
Noted in 5.0.19 changelog.