我有一个帐户表。帐户ID 1的平衡是550.一个mysql的连接是这样做的:
START TRANSACTION;
update accounts set balance = balance - 200 where id = 1 #TIME t
update accounts set balance = balance + 200 where id = 2 #TIME t + 100
COMMIT
现在假设另一个连接正在执行此操作:
START TRANSACTION;
update accounts set balance = balance - 100 where id = 1 and balance > 500 #TIME t + 50
COMMIT
我想知道数据库的最终状态是什么?为什么?