fix:トランザクション処理の追加
This commit is contained in:
parent
76cf08ebdd
commit
ba56ec8b5a
@ -10,10 +10,13 @@ BEGIN
|
|||||||
@error_state = RETURNED_SQLSTATE, @error_msg = MESSAGE_TEXT;
|
@error_state = RETURNED_SQLSTATE, @error_msg = MESSAGE_TEXT;
|
||||||
EXECUTE drop_tmp_table_stmt;
|
EXECUTE drop_tmp_table_stmt;
|
||||||
DEALLOCATE PREPARE drop_tmp_table_stmt;
|
DEALLOCATE PREPARE drop_tmp_table_stmt;
|
||||||
|
ROLLBACK;
|
||||||
SIGNAL SQLSTATE '45000'
|
SIGNAL SQLSTATE '45000'
|
||||||
SET MYSQL_ERRNO = @error_state, MESSAGE_TEXT = @error_msg;
|
SET MYSQL_ERRNO = @error_state, MESSAGE_TEXT = @error_msg;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
-- ②-3で利用する一時テーブル削除のSQLを準備
|
-- ②-3で利用する一時テーブル削除のSQLを準備
|
||||||
-- 例外処理でも利用するため先に記述
|
-- 例外処理でも利用するため先に記述
|
||||||
SET @drop_tmp_table = '
|
SET @drop_tmp_table = '
|
||||||
@ -85,4 +88,6 @@ BEGIN
|
|||||||
EXECUTE drop_tmp_table_stmt;
|
EXECUTE drop_tmp_table_stmt;
|
||||||
DEALLOCATE PREPARE drop_tmp_table_stmt;
|
DEALLOCATE PREPARE drop_tmp_table_stmt;
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
END
|
END
|
||||||
Loading…
x
Reference in New Issue
Block a user