diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-11-27 11:02:08 +0100 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-11-27 11:02:08 +0100 |
commit | 039bc6125d8a6a2161349b74c86c27610ce91c70 (patch) | |
tree | 394ca1b7638805c272f509897c97e562e60109eb /sql/rpl_gtid.cc | |
parent | acc539a2c4a8ac591a641ad47c699305839997b8 (diff) | |
download | mariadb-git-039bc6125d8a6a2161349b74c86c27610ce91c70.tar.gz |
MDEV-4816: Incorrect disabling of binlog for mysql.gtid_slave_pos update
The update of mysql.gtid_slave_pos during event replication used
the wrong way to disable binary logging for the table updates.
Fix to instead temporarily clear the OPT_BIN_LOG flag.
Diffstat (limited to 'sql/rpl_gtid.cc')
-rw-r--r-- | sql/rpl_gtid.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index 830c8d3ab78..3f79a0cb528 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -203,17 +203,15 @@ rpl_slave_state::truncate_state_table(THD *thd) { TABLE_LIST tlist; int err= 0; - TABLE *table; + tmp_disable_binlog(thd); tlist.init_one_table(STRING_WITH_LEN("mysql"), rpl_gtid_slave_state_table_name.str, rpl_gtid_slave_state_table_name.length, NULL, TL_WRITE); if (!(err= open_and_lock_tables(thd, &tlist, FALSE, 0))) { - table= tlist.table; - table->no_replicate= 1; - err= table->file->ha_truncate(); + err= tlist.table->file->ha_truncate(); if (err) { @@ -230,6 +228,7 @@ rpl_slave_state::truncate_state_table(THD *thd) thd->mdl_context.release_transactional_locks(); } + reenable_binlog(thd); return err; } @@ -349,13 +348,14 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, if ((err= gtid_check_rpl_slave_state_table(table))) goto end; - table->no_replicate= 1; if (!in_transaction) { DBUG_PRINT("info", ("resetting OPTION_BEGIN")); thd->variables.option_bits&= - ~(ulonglong)(OPTION_NOT_AUTOCOMMIT|OPTION_BEGIN); + ~(ulonglong)(OPTION_NOT_AUTOCOMMIT|OPTION_BEGIN|OPTION_BIN_LOG); } + else + thd->variables.option_bits&= ~(ulonglong)OPTION_BIN_LOG; bitmap_set_all(table->write_set); |