If I kill the delete request in mysql, will all rows be saved?

Suppose I am halfway to starting import and instead of starting

SELECT COUNT(*) FROM table_being_imported 

I press ctrl + R , type table_being_im and table_being_im return, only to find my horror I just released

 DELETE FROM table_being_imported 

Unfortunately. So I hit ctrl + C and said:

 Ctrl-C -- sending "KILL QUERY 627" to server ... Ctrl-C -- query aborted. ERROR 1317 (70100): Query execution was interrupted 

Would delete any of the lines? Just hypothetically, of course ...

+4
source share
1 answer

hypothetically, ... some of these lines have now disappeared.

During UPDATE or DELETE operations, the kill flag is checked after every block reading and after every updated or deleted row. If the kill flag is set, the statement is aborted. Please note: if you do not use transactions, the changes are not rolled back.

Not that it's time to mention this, but that is why transactional queries are best suited for working with business-critical data.

+9
source

All Articles