
mysql> <LONG RUNNING INCORRECT UPDATE STATEMENT>
^CCtrl-C -- sending "KILL QUERY 12088743" to server ...
Ctrl-C -- query aborted.
ERROR 1317 (70100): Query execution was interrupted
mysql>
更新:查询中涉及的所有表都是InnoDB表.
MySQL includes components such as the InnoDB storage engine that adhere closely to the ACID model, so that data is not corrupted and results are not distorted by exceptional conditions such as software crashes and hardware malfunctions.
对于MYISAM:但对于非事务性的MyISAM存储引擎.这样的存储引擎遵循一种模型,其中数据一次写入一个语句.这是使用原子操作完成的.因此,如果您中断该过程,那么您将直到中断为止.
The nontransactional storage engines in MySQL Server (such as MyISAM) follow a different paradigm for data integrity called “atomic operations”. MyISAM tables effectively always operate in autocommit = 1 mode. Because changed data is written to disk one statement at a time, it is harder to guarantee the consistency of a sequence of related DML operations, which could be interrupted partway through. Thus, this mode is suitable for read-mostly workloads. In transactional terms, while each specific update is running, no other user can interfere with it, there can never be an automatic rollback, and there are no dirty reads.
但是,您可以使用LOCK TABLES作为解决方法.这是MySQL 5.5之前的默认存储引擎. *
所以答案取决于您使用的存储引擎.希望有帮助:)
转载注明原文:MySQL – 当UPDATE命令被中断时会发生什么? - 乐贴网