MDEV-14472 Assertion `is_current_stmt_binlog_format_row()' failed...
in THD::binlog_write_table_map Problem:- So the issue is when the test case (mdev_14472) is run with debug build , Assert DBUG_ASSERT(is_current_stmt_binlog_format_row()); is fired in binlog_write_table_map. Analysis:- When we lock table t1, and if t1 has some trigger which updates another table then all other tables are also locked. So in the case of lock t1(in mdev_14472 test case) we will lock t1, t2, t3 and t4. In next insert command (t2 insert), we call handler->check_table_row_based from write_locked_table_maps which updates the table handler check_table_binlog_row_based_done to 1 and check_table_binlog_row_based_result to 1 , it is set to one because this particular insert stmt is unsafe(because of trigger on t4). The next insert stmt(insert t3) is safe so we will write that in stmt format , but since we havent cleared the previous check_table_binlog_row_based_result so it is logged in row format while thd->is_current_stmt_binlog_format_row() is still 0, and this fires the assert. So the question is why check_table_binlog_row_based_result is not reseted because mark_used_tables_as_free_for_reuse skips locked tables Solution:- We make mark_used_tables_as_free_for_reuse to reset check_table_binlog_row_based_result even when table is locked
Showing
Please register or sign in to comment