Just wanted to call folks' attention to this, because I don't think it's well known. If you launch the mysql utility and connect to your database, you'd probably expect these three queries to do nothing:
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.
1 comment
[ 2.9 ms ] story [ 10.2 ms ] threadYou can disable this behavior using the --disable-reconnect flag.