fix:トランザクション処理の追加

This commit is contained in:
y-ono-r 2022-08-01 20:02:29 +09:00 committed by shimoda.m@nds-tyo.co.jp
parent 76cf08ebdd
commit ba56ec8b5a

View File

@ -10,10 +10,13 @@ BEGIN
@error_state = RETURNED_SQLSTATE, @error_msg = MESSAGE_TEXT;
EXECUTE drop_tmp_table_stmt;
DEALLOCATE PREPARE drop_tmp_table_stmt;
ROLLBACK;
SIGNAL SQLSTATE '45000'
SET MYSQL_ERRNO = @error_state, MESSAGE_TEXT = @error_msg;
END;
START TRANSACTION;
-- ②-3で利用する一時テーブル削除のSQLを準備
-- 例外処理でも利用するため先に記述
SET @drop_tmp_table = '
@ -85,4 +88,6 @@ BEGIN
EXECUTE drop_tmp_table_stmt;
DEALLOCATE PREPARE drop_tmp_table_stmt;
COMMIT;
END