MySQL transactions are not safe (from the command line)
dba.stackexchange.com
dba.stackexchange.com
START TRANSACTION;
UPDATE clients SET important_field = NULL;
ROLLBACK;
But if the connection is lost between the first and second queries, the mysql client will "auto-reconnect" and send the second query—even though it's no longer in a transaction.You can disable this behavior using the --disable-reconnect flag.