Bug #16143 mysql_stmt_sqlstate returns an empty string instead of '00000'
Submitted: 2 Jan 2006 23:58 Modified: 15 Feb 2006 20:26
Reporter: Eric Huss (Candidate Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.15 OS:Any (all)
Assigned to: Magnus Blåudd CPU Architecture:Any

[2 Jan 2006 23: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 12: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 14:13] Magnus Blåudd
Pushed to 5.0.19
[15 Feb 2006 20:26] Paul Dubois
Noted in 5.0.19 changelog.