开发者

MySQL transaction in stored procedure

开发者 https://www.devze.com 2023-01-15 10:00 出处:网络
I created a transaction in a stored procedure with some update statements. What will happen if the transaction is running, and one select request the value from the 开发者_运维知识库updating table?MyS

I created a transaction in a stored procedure with some update statements. What will happen if the transaction is running, and one select request the value from the 开发者_运维知识库updating table?


MySQL will return the value of the select at that specific point in time. So if the select occurs before the update you will get the before value. If the select occurs after the update you will get the after value.

By default selects are read only so you will not have locking issues.

0

精彩评论

暂无评论...
验证码 换一张
取 消