From ba56ec8b5a7d6c3b4c57b36051665e7f77311127 Mon Sep 17 00:00:00 2001 From: y-ono-r <95060536+y-ono-r@users.noreply.github.com> Date: Mon, 1 Aug 2022 20:02:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=E3=83=88=E3=83=A9=E3=83=B3=E3=82=B6?= =?UTF-8?q?=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E5=87=A6=E7=90=86=E3=81=AE?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rds_mysql/stored_procedure/crm_history.sql | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rds_mysql/stored_procedure/crm_history.sql b/rds_mysql/stored_procedure/crm_history.sql index f361a850..7573bf9b 100644 --- a/rds_mysql/stored_procedure/crm_history.sql +++ b/rds_mysql/stored_procedure/crm_history.sql @@ -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 \ No newline at end of file