Condition Handling Suppose that the  DROP TABLE xx  statement fails. The diagnostics area stack looks like this: DA 1. ERROR 1051 (42S02): Unknown table ’xx’ Then execution enters the  EXIT  handler. It starts by pushing a diagnostics area to the top of the stack, which now looks like this: DA 1. ERROR 1051 (42S02): Unknown table ’xx’ DA 2. ERROR 1051 (42S02): Unknown table ’xx’ At this point, the contents of the first (current) and second (stacked) diagnostics areas are the same. The first diagnostics area may be modified by statements executing subsequently within the handler. Usually a procedure statement clears the first diagnostics area.  BEGIN  is an exception, it does not clear, it does nothing.  SET  is not an exception, it clears, performs the operation, and produces a result of “success.”  The diagnostics area stack now looks like this: DA 1. ERROR 0000 (00000): Successful operation DA 2. ERROR 1051 (42S02): Unknown table ’xx’ At this point, if  @a = 0 ,  RESIGNAL  pops the diagnostics area stack, which now looks like this: DA 1. ERROR 1051 (42S02): Unknown table ’xx’ And that is what the caller sees. If  @a  is not 0, the handler simply ends, which means that there is no more use for the current diagnostics area (it has been “handled” ), so it can be thrown away, causing the stacked diagnostics area to become the current diagnostics area again. The diagnostics area stack looks like this: DA 1. ERROR 0000 (00000): Successful operation The details make it look complex, but the end result is quite useful: Handlers can execute without destroying information about the condition that caused activation of the handler. RESIGNAL  with a  SET  clause provides new signal information, so the statement means “pass on the error with changes” : RESIGNAL SET  signal_information_item  [,  signal_information_item ] ...; As with  RESIGNAL  alone, the idea is to pop the diagnostics area stack so that the original information goes out. Unlike  RESIGNAL  alone, anything specified in the  SET  clause changes. Example: 2819 RESIGNAL with New Signal Information IF @a = 0 THEN RESIGNAL; END IF; END; DROP TABLE xx; END// delimiter ; SET @error_count = 0; SET @a = 0; CALL p(); DROP TABLE IF EXISTS xx; delimiter // CREATE PROCEDURE p () BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN