MDEV-29989 binlog_do_db option breaks versioning table
Problem: ========= During commit, server calls prepare_commit_versioned to determine the transaction modified system-versioned data. Due to binlog_do_db option, we disable the binlog for the statement. But prepare_commit_versioned() is being called only when binlog is enabled for the statement. Fix: === prepare_commit_versioned() should happen irrespective of binlog state. So if the server has any read-write operation then we should call prepare_commit_versioned().
This commit is contained in:
parent
ca66a2cbfa
commit
952f06aa8b
2
mysql-test/suite/versioning/t/trx_id.opt
Normal file
2
mysql-test/suite/versioning/t/trx_id.opt
Normal file
@ -0,0 +1,2 @@
|
||||
--log_bin
|
||||
--binlog_do_db=foo
|
@ -1510,8 +1510,7 @@ int ha_commit_trans(THD *thd, bool all)
|
||||
|
||||
uint rw_ha_count= ha_check_and_coalesce_trx_read_only(thd, ha_info, all);
|
||||
/* rw_trans is TRUE when we in a transaction changing data */
|
||||
bool rw_trans= is_real_trans &&
|
||||
(rw_ha_count > (thd->is_current_stmt_binlog_disabled()?0U:1U));
|
||||
bool rw_trans= is_real_trans && rw_ha_count > 0;
|
||||
MDL_request mdl_backup;
|
||||
DBUG_PRINT("info", ("is_real_trans: %d rw_trans: %d rw_ha_count: %d",
|
||||
is_real_trans, rw_trans, rw_ha_count));
|
||||
|
Loading…
x
Reference in New Issue
Block a user