确保数据的一致性,在有其他事务使用表的情况下,对该表的DDL操作都应该阻塞,from 5.5.3
step1——
session1:
mysql> begin;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from t1;
+------+
| f1 |
+------+
| 100 |
+------+
1 row in set (0.00 sec)
session2
mysql> drop table t1;
~output 挂起状态
step2——
session1:
mysql> rollback;
Query OK, 0 rows affected (0.00 sec)
session2:
mysql> drop table t1;
Query OK, 0 rows affected (25.17 sec)