简体   繁体   中英

InnoDB behavior for a transaction updating MyISAM and InnoDB tables

I read most of example InnoDB on this website but I have no clue for InnoDB behavior.

As far As I found out

START TRANSACTION;

Is declaring this is a transaction connection. It's OK till here. NOW I have 3 tables:

  • tbl1 with InnoDB engine
  • tbl2 MyISAM Engine
  • tbl3 InnoDB

Sequence of updates:

SET AUTOCOMMIT=0
START TRANSACTION;
UPDATE tbl2 SET column=1 WHERE (SELECT clumn FROM tbl WHERE column2=1);
UPDATE tbl3 SET column=1;
Rollback;

What will happen to MyISAM table is it rollback or only tbl3 and tbl1 will be rollback?

MyISAM doesn't know anything about transactions, and it cannot roll back changes.

So if you roll back, the changes to tbl3 will be discarded, but the changes to tbl2 will remain.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM