WL#2265: Stored Procedures: Implement RESIGNAL

Affects: Server-5.5   —   Status: Complete

MySQL will implement the standard SQL (SQL:2008) RESIGNAL
statement, which is used to pass forward an error or warning 
condition which is trapped in a handler of a compound
statement.

This is a subtask needed for stored procedures. It was 
decided at the Malta conference that this feature does 
not need to be implemented for the MySQL 5.0 release. 
For a while we said "it is now due for 5.1". Now we say
it is on the roadmap as a must-have item for 6.x.

Assume that WL#2110 (SIGNAL) will happen first.

Rationale
---------

Standard requirement:
RESIGNAL is part of SQL:2008 non-core feature P002
Computational Completeness. Additionally the standard
requires support of "implicit RESIGNAL" but that is
not one of the requirements for this task.

Needed functionality:
Right now there's no way to both handle an error
and return the error message -- by executing an SQL
statement within the handler, we destroy the
information that caused the handler's activation.
Also, it would make some procedures shorter if one
could handle part of a situation, then pass the
condition 'up the line' to another handler.

Compatibility:
IBM DB2 supports RESIGNAL in the standard-SQL manner.
Oracle doesn't support RESIGNAL syntax, but does provide 
similar functionality: use RAISE without an exception
name to "reraise an exception".
SQL Server does not support an equivalent functionality
other than the RAISERROR  statement, which
is closer to SIGNAL than to RESIGNAL.

In the Santa Cruz Dev-Mt Offsite meeting (2006-08), Brian
Aker and Monty Widenius made some time estimates and statements about
dependencies (see "Progress Reports" for details).
Marc Alff may have different estimates.