## RESIGNAL Overview 

For condition_value  and signal_information_item , the definitions and rules are the same for RESIGNAL  as for SIGNAL . For example, the condition_value  can be an SQLSTATE  value, and the value can indicate errors, warnings, or “not found.”  For additional information, see Section 13.6.7.5, “SIGNAL Statement” . 

The RESIGNAL  statement takes condition_value  and SET  clauses, both of which are optional. This leads to several possible uses: 

• RESIGNAL  alone: 

RESIGNAL; 

• RESIGNAL  with new signal information: 

RESIGNAL SET signal_information_item  [, signal_information_item ] ...; 

• RESIGNAL  with a condition value and possibly new signal information: 

RESIGNAL condition_value [SET signal_information_item  [, signal_information_item ] ...]; 

These use cases all cause changes to the diagnostics and condition areas: 

•A diagnostics area contains one or more condition areas. 

•A condition area contains condition information items, such as the SQLSTATE  value, MYSQL_ERRNO , or MESSAGE_TEXT . 

There is a stack of diagnostics areas. When a handler takes control, it pushes a diagnostics area to the top of the stack, so there are two diagnostics areas during handler execution: 

•The first (current) diagnostics area, which starts as a copy of the last diagnostics area, but is overwritten by the first statement in the handler that changes the current diagnostics area. 

•The last (stacked) diagnostics area, which has the condition areas that were set up before the handler took control. 

The maximum number of condition areas in a diagnostics area is determined by the value of the max_error_count  system variable. See Diagnostics Area-Related System Variables. 

## RESIGNAL Alone 

A simple RESIGNAL  alone means “pass on the error with no change.”  It restores the last diagnostics area and makes it the current diagnostics area. That is, it “pops”  the diagnostics area stack. 

Within a condition handler that catches a condition, one use for RESIGNAL  alone is to perform some other actions, and then pass on without change the original condition information (the information that existed before entry into the handler). 

Example: 

DROP TABLE IF EXISTS xx; delimiter // CREATE PROCEDURE p () BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN SET @error_count = @error_count + 1; 

