(MySQL 5.5,InnoDB 表)为什么我不能回滚到保存点或上一个begin
语句?
mysql> set autocommit=0;
Query OK, 0 rows affected (0.00 sec)
mysql> start transaction;
Query OK, 0 rows affected (0.00 sec)
mysql> savepoint id;
Query OK, 0 rows affected (0.00 sec)
mysql> alter table sg_Section add column (published tinyint(1) default 0);
Query OK, 2 rows affected (0.30 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> rollback to savepoint id;
ERROR 1305 (42000): SAVEPOINT id does not exist
在保存点之后不运行任何命令时,它似乎“工作”:
mysql> savepoint id;
Query OK, 0 rows affected (0.00 sec)
mysql> rollback to savepoint id;
Query OK, 0 rows affected (0.00 sec)