Bug #9889 Rollbacked transaction cause replication error
Submitted: 14 Apr 2005 7:35 Modified: 14 May 2005 8:40
Reporter: Oscar Yen Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:mysql-4.0.12 OS:Linux (rh-8)
Assigned to: CPU Architecture:Any

[14 Apr 2005 7:35] Oscar Yen
Description:
If you modify both innodb and myiasm tables within same transaction and roll backed it finaly, of cause the roll back will be failed because myiasm tables do not support transaction and get an error of 

ERROR 1196: Warning:  Some non-transactional changed tables couldn't be rolled back

As my test, the modification to both innodb & myiasm tables have been COMMITED at this point, how ever, the worst thing is all sql modifing innodb tables WON'T be written to binlog!!, replication slave will miss these statements and cause data integrity fail.

How to repeat:
use test;

mysql> create table my_table(n int);
Query OK, 0 rows affected (0.01 sec)

mysql> create table inn_table(n int) type=innodb;
Query OK, 0 rows affected (0.04 sec)

mysql> begin;
Query OK, 0 rows affected (0.00 sec)

mysql> insert inn_table values(1);
Query OK, 1 row affected (0.00 sec)

mysql> insert my_table values(1);
Query OK, 1 row affected (0.00 sec)

mysql> rollback;
ERROR 1196: Warning:  Some non-transactional changed tables couldn't be rolled back
mysql> select * from inn_table;
+------+
| n    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

mysql> select * from my_table;
+------+
| n    |
+------+
|    1 |
+------+
1 row in set (0.00 sec)

mysql>

mysqlbinlog --database test mysql-bin.036 will output like this:

# at 6132814
#050414 15:00:46 server id 1  log_pos 6132814   Query   thread_id=2985  exec_time=0     error_code=0
SET TIMESTAMP=1113462046;
create table my_table(n int);
# at 6132877
#050414 15:00:59 server id 1  log_pos 6132877   Query   thread_id=2985  exec_time=0     error_code=0
SET TIMESTAMP=1113462059;
create table inn_table(n int) type=innodb;
# at 6132953
#050414 15:01:44 server id 1  log_pos 6132953   Query   thread_id=2985  exec_time=0     error_code=0
SET TIMESTAMP=1113462104;
insert my_table values(1);

***You see, no "insert inn_table value(1)" in the binlog***
[14 Apr 2005 8:40] Heikki Tuuri
Hi!

Please test with 4.1.11. Many bugs in the replication of mixed MyISAM/InnoDB transactions have been fixed since 4.0.12.

Regards,

Heikki
[14 May 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".