Bug #37311 replication with triggers + innodb tables in recent 5.1 versions is buggy
Submitted: 10 Jun 2008 14:48 Modified: 18 Jul 2008 10:40
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Replication Severity:S1 (Critical)
Version:5.1.24 OS:Any
Assigned to: CPU Architecture:Any

[10 Jun 2008 14:48] Shane Bester
Description:
while trying to repeat bug #37093 the slave broke with these errors

Last_Error: Error 'Can't update table 'tbl_week_ticks' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.' on opening table `test`.`tbl_week_ticks`

080610 16:33:42  InnoDB: Error: MySQL is freeing a thd
InnoDB: though trx->n_mysql_tables_in_use is 2
InnoDB: and trx->mysql_n_tables_locked is 2.

and then after skipping some statements in the relay log, and restarted replciation, the slave eventually crashed with stack trace:

mysqld.exe!remove_table_from_cache
mysqld.exe!lock_table_name
mysqld.exe!lock_table_names
mysqld.exe!lock_table_names_exclusively
mysqld.exe!mysql_rm_table_part2
mysqld.exe!mysql_rm_table
mysqld.exe!mysql_execute_command
mysqld.exe!mysql_parse
mysqld.exe!Query_log_event::do_apply_event
mysqld.exe!Query_log_event::do_apply_event
mysqld.exe!apply_event_and_update_pos
mysqld.exe!exec_relay_log_event
mysqld.exe!handle_slave_sql
mysqld.exe!pthread_start
mysqld.exe!_threadstart

please see full outputs in the attached file.

How to repeat:
master: 5.1.23
slave: 5.1.23

insert into a table with triggers and replicate the events to slave.

my.cnf:
binlog_format=row
old-passwords=1
[10 Jun 2008 14:57] MySQL Verification Team
full stack, full slave error log, and the test i was running.

Attachment: bug37311_outputs.txt (text/plain), 13.91 KiB.

[18 Jul 2008 10:40] MySQL Verification Team
i didn't manage to repeat this bug again.