I need to create a stored function which disables triggers on demand. At first I have a parameter @disable_triggers which can I set to "all" or to specific trigger name. In the trigger I would have a variable which I assign to procedures return value and if it's true I don't execute trigger code. So in procedure I need to somehow handle the case with specific trigger name.
CREATE PROCEDURE `DisableTriggers`()
BEGIN
IF(@disable_triggers = 'all') THEN
RETURN 1;
END IF;
IF (@disable_triggers CONTAINS 'Specific trigger name') THEN
Return true to disable specific trigger. <<-- how to return it here.
END IF;
END
So the question I ask is how to handle the case with specific triggers what to return.