Condition Handling DA 1. (condition 2) ERROR 1051 (42S02): Unknown table ’xx’ (condition 1) ERROR 5 (45000) Unknown table ’xx’ mysql>  CALL p(); ERROR 5 (45000): Unknown table ’xx’ mysql>  SHOW ERRORS; +-------+------+----------------------------------+ | Level | Code | Message | +-------+------+----------------------------------+ | Error | 1051 | Unknown table ’xx’ | | Error | 5 | Unknown table ’xx’ | +-------+------+----------------------------------+ The result of  CALL p()  and  SHOW ERRORS  for this example is: All forms of  RESIGNAL  require that the current context be a condition handler. Otherwise,  RESIGNAL  is illegal and a  RESIGNAL when handler not active  error occurs. For example: Here is a more difficult example: mysql>  CREATE PROCEDURE p () RESIGNAL; Query OK, 0 rows affected (0.00 sec) mysql>  CALL p(); ERROR 1645 (0K000): RESIGNAL when handler not active delimiter // CREATE FUNCTION f () RETURNS INT BEGIN RESIGNAL; RETURN 5; END// CREATE PROCEDURE p () BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION SET @a=f(); SIGNAL SQLSTATE ’55555’; END// delimiter ; CALL p(); SIGNAL  condition_value [SET  signal_information_item [,  signal_information_item ] ...] condition_value : { SQLSTATE [VALUE]  sqlstate_value |  condition_name } signal_information_item : condition_information_item_name  =  simple_value_specification condition_information_item_name : { CLASS_ORIGIN | SUBCLASS_ORIGIN | MESSAGE_TEXT RESIGNAL  occurs within the stored function  f() . Although  f()  itself is invoked within the context of the EXIT  handler, execution within  f()  has its own context, which is not handler context. Thus,  RESIGNAL within  f()  results in a “handler not active”  error. 13.6.7.5 SIGNAL Statement 2821 RESIGNAL Requires Condition Handler Context