Syntax\n------\n\nRESIGNAL [error_condition]\n    [SET error_property\n    [, error_property] ...]\n\nerror_condition:\n    SQLSTATE [VALUE] 'sqlstate_value'\n  | condition_name\n\nerror_property:\n    error_property_name = <error_property_value>\n\nerror_property_name:\n    CLASS_ORIGIN\n  | SUBCLASS_ORIGIN\n  | MESSAGE_TEXT\n  | MYSQL_ERRNO\n  | CONSTRAINT_CATALOG\n  | CONSTRAINT_SCHEMA\n  | CONSTRAINT_NAME\n  | CATALOG_NAME\n  | SCHEMA_NAME\n  | TABLE_NAME\n  | COLUMN_NAME\n  | CURSOR_NAME\n\nDescription\n-----------\n\nThe syntax of RESIGNAL and its semantics are very similar to SIGNAL. This statement can only be used within an error HANDLER. It produces an error, like SIGNAL. RESIGNAL clauses are the same as SIGNAL, except that they all are optional, even SQLSTATE. All the properties which are not specified in RESIGNAL, will be identical to the properties of the error that was received by the error HANDLER. For a description of the clauses, see diagnostics area.\n\nRESIGNAL does not empty the diagnostics area. It just appends another error condition.\n\nRESIGNAL, without any clauses, produces an error which is identical to the error that was received by HANDLER.\n\nIf used out of a HANDLER construct, RESIGNAL produces the following error:\n\n``sql\nERROR 1645 (0K000): RESIGNAL when handler not active\n`\n\nIf a HANDLER contains a CALL to another procedure, that procedure can use RESIGNAL, but trying to do this raises the above error.\n\nIf a HANDLER contains a CALL to another procedure, that procedure can use RESIGNAL.\n\nFor a list of SQLSTATE values and MariaDB error codes, see MariaDB Error Codes.\n\nThe following procedure tries to query two tables which don't exist, producing a 1146 error in both cases. Those errors will trigger the HANDLER. The first time the error will be ignored, and the client will not receive it, but the second time, the error is re-signaled, so the client will receive it.\n\n`sql\nCREATE PROCEDURE test_error( )\nBEGIN\n   DECLARE CONTINUE HANDLER\n      FOR 1146\n   BEGIN\n   IF @hide_errors IS FALSE THEN\n      RESIGNAL;\n   END IF;\n   END;\n   SET @hide_errors = TRUE;\n   SELECT 'Next error will be ignored' AS msg;\n   SELECT c FROM temptab_one;\n   SELECT 'Next error won''t be ignored' AS msg;\n   SET @hide_errors = FALSE;\n   SELECT c FROM temptab_two;\nEND;\n\nCALL test_error( );\n\n+----------------------------+\n| msg                        |\n+----------------------------+\n| Next error will be ignored |\n+----------------------------+\n\n+-----------------------------+\n| msg                         |\n+-----------------------------+\n| Next error won't be ignored |\n+-----------------------------+\n\nERROR 1146 (42S02): Table 'test.temptab_two' doesn't exist\n`\n\nThe following procedure re-signals an error, modifying only the error message to clarify the cause of the problem.\n\n`sql\nCREATE PROCEDURE test_error()\nBEGIN\n   DECLARE CONTINUE HANDLER\n   FOR 1146\n   BEGIN\n      RESIGNAL SET\n      MESSAGE_TEXT = 'temptab does not exist';\n   END;\n   SELECT c FROM temptab;\nEND;\n\nCALL test_error( );\nERROR 1146 (42S02): temptab does not exist\n`\n\n`sql\nCREATE PROCEDURE handle_error()\nBEGIN\n  RESIGNAL;\nEND;\nCREATE PROCEDURE p()\nBEGIN\n  DECLARE EXIT HANDLER FOR SQLEXCEPTION CALL p();\n  SIGNAL SQLSTATE '45000';\nEND;\n``\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/programmatic-compound-statements/resignal