我有一个读取和更新多个表的 MySQL 存储过程,所以我希望它是一个事务。默认情况下它已经是事务性的了吗?或者我需要做些什么吗?
MySQL 5.0+
最佳答案
我不这么认为。根据manual section on BEGIN...END
statements :
Within all stored programs (stored procedures and functions, triggers, and events), the parser treats BEGIN [WORK] as the beginning of a BEGIN ... END block. Begin a transaction in this context with START TRANSACTION instead.
关于mysql - MySQL 存储过程默认是事务性的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6171933/