3 ms·
_You are using mysql, you make a transaction with say deposit and withdraw._ _What happens on the mysql machine if you pull the plug exactly when mysql has don
by hibbelig 10y ago
_You are using mysql, you make a transaction with say deposit and withdraw._
_What happens on the mysql machine if you pull the plug exactly when mysql has done the deposit but not the withdraw?_
MySQL guarantees that this cannot happen. That's what transactions are all about.
For example you can put into the log the two operations and then an end of transaction marker. When the system comes back after a crash you can replay those transactions from the log that have the end marker, and roll back those that don't.