MySQL: Transactions in MyISAM and InnoDB

Test

CREATE TABLE `t01` (
`column_of_t01` int(11) DEFAULT NULL
) ENGINE=MyISAM;

CREATE TABLE `t02` (
`column_of_t02` int(11) DEFAULT NULL
) ENGINE=InnoDB;
start transaction;
insert into t01(column_of_t01) values(666);
insert into t02(column_of_t02) values(666);
select * from t01;
select * from t02;
rollback;
select * from t01;
select * from t02;

results before rollback:

mysql> select * from t01;
±--------------+
| column_of_t01 |
±--------------+
|           666 |
±--------------+
1 row in set (0.00 sec)

mysql> select * from t02;
±--------------+
| column_of_t02 |
±--------------+
|           666 |
±--------------+
1 row in set (0.00 sec)

results after rollback:

mysql> select * from t01;
±--------------+
| column_of_t01 |
±--------------+
|           666 |
±--------------+
1 row in set (0.00 sec)

mysql> select * from t02;
Empty set (0.00 sec)

 

You looked at absence of transactions in MyISAM and at transactions in InnoDB by your own eyes .