Bug #18682 error_code and sql_status not available inside a stored procedure
Submitted: 31 Mar 2006 11:14 Modified: 24 Apr 2006 9:53
Reporter: Claudio G Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:MySQL 5.1 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[31 Mar 2006 11:14] Claudio G
Description:
The error_code and sqlstatus values should be available inside a stored procedure as user or session variables.  Whitout this ,it is impossible to write a simple generic handler that prints the error code.
Something essential for debugging.

How to repeat:
Write a simple stored procedure and try to catch a generic error with a handler that prints
a useful message.

Suggested fix:
session variables @error_code and @sqlstatus
[24 Apr 2006 9:53] Valeriy Kravchuk
Looks like a duplicate of a know feature request (bug #16371 and, maybe, others). Will be implemented eventually.