salix/db/changes/10141-zoneDoCalc/02-procNoOverlap.sql

31 lines
494 B
MySQL
Raw Normal View History

2020-02-06 15:04:23 +00:00
USE `util`;
DROP procedure IF EXISTS `procNoOverlap`;
DELIMITER $$
USE `util`$$
CREATE PROCEDURE `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 ;