I want a trigger on a table to fail if a transaction isn't active. I've tried to used the autocommit
variable, but it apparently isn't affected by START TRANSACTION
so it will in my case always be 1
anyway. I want to do something like:
IF ![transaction check] THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT='Transaction must be active';
END IF;
How can I do this?