FOR INNODB : The Mysql manual says that InnoDB
(a transactional storage engine) provides full ACID complaince. So therefore it will do complete all the operations at once or will not do the operations and rollback in case of an interruption. This is the default engine from MySQL 5.5 and up.
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.
FOR MYISAM :However for MyISAM
storage engine which is non-transactional. Such storage engines follow a model where data is written one statement at a time . This is done using atomic operations. So if you interrupt the process then you will get it upto the point until you interrupted.
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.
However you can use LOCK TABLES
as a workaround. This was the default storage engine before MySQL 5.5. *
So the answer depends on which storage engine you are using. Hope that helps :)