salix/db/routines/util/procedures/procNoOverlap.sql

25 lines
470 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`procNoOverlap`(procName VARCHAR(255))
SQL SECURITY INVOKER
proc: BEGIN
/**
* call procedure without overlap
*/
DECLARE vIsChanged BOOL;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
BEGIN
DO RELEASE_LOCK(procName);
RESIGNAL;
END;
IF !GET_LOCK(procName, 0) THEN
LEAVE proc;
END IF;
CALL exec(CONCAT('CALL ', procName));
DO RELEASE_LOCK(procName);
END$$
DELIMITER ;