set autocommit = 0;
start TRANSACTION;
delete from student where id = 1;
SAVEPOINT b;
ROLLBACK to b;
上述语句可以正确回滚,并没有真正删除数据
如果delete的where去掉,整个表都会被删除并且这个事务没有结束,是什么原因呢?求解求解求解。
set autocommit = 0;
start TRANSACTION;
delete from student where id = 1;
SAVEPOINT b;
ROLLBACK to b;
上述语句可以正确回滚,并没有真正删除数据
如果delete的where去掉,整个表都会被删除并且这个事务没有结束,是什么原因呢?求解求解求解。