Bug #73145 Suggest SQLSTATE for user warning/not found condition
Submitted: 30 Jun 2014 8:10 Modified: 1 Jul 2014 8:51
Reporter: Federico Razzoli Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Stored Routines Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: diagnostics-area
Triage: Needs Triage: D5 (Feature request)

[30 Jun 2014 8:10] Federico Razzoli
Description:
In this page:

http://dev.mysql.com/doc/refman/5.6/en/signal.html

I read:

"To signal a generic SQLSTATE value, use '45000', which means “unhandled user-defined exception.”"

I find it a useful suggestion, so we have a SQLSTATE officially dedicated to user-defined conditions. This way our applications can check the SQLSTATE - if it is '45000', they will know it is not a builtin error, so no matter if we use an already-in-use MYSQL_ERRNO.

However, it is only good for exceptions (fatal error, SQLEXCEPTION condition). We would need at least an SQLSTATE for user-defined warnings (non-fatal conditions!) and, possibly, one for NOT FOUND conditions (easy: MySQL only uses '02000').

How to repeat:
How to repeat what? :)
[1 Jul 2014 8:51] Umesh Shastry
Hello Federico,

Thank you for the feature request!

Thanks,
Umesh