refs #2687 feat: new transaction procedure utils

This commit is contained in:
Javier Segarra 2023-12-11 14:53:55 +01:00
parent a8dfe8f3bf
commit 64fbbd5dda
3 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,12 @@
DROP PROCEDURE IF EXISTS util.tx_commit;
DELIMITER $$
$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_commit`(IN tx BOOL)
BEGIN
IF tx THEN
COMMIT;
END IF;
END
$$
DELIMITER ;

View File

@ -0,0 +1,12 @@
DROP PROCEDURE IF EXISTS util.tx_rollback;
DELIMITER $$
$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_rollback`(tx BOOL)
BEGIN
IF tx THEN
ROLLBACK;
END IF;
END
$$
DELIMITER ;

View File

@ -0,0 +1,12 @@
DROP PROCEDURE IF EXISTS util.tx_start;
DELIMITER $$
$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_start`(tx BOOL)
BEGIN
IF tx THEN
START TRANSACTION;
END IF;
END
$$
DELIMITER ;