summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-04-22 18:13:30 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2015-04-22 18:13:30 -0400
commit581b49dd3d3e2e253812bb24fa881148675320b4 (patch)
tree23f26b59c27c6fcd814913716389e8b4cf4ebc55 /sql/log.cc
parentd7445ea6dfbd3be390792c636f755d3bb40d5fbf (diff)
downloadmariadb-git-581b49dd3d3e2e253812bb24fa881148675320b4.tar.gz
MDEV-7995 : DMLs not getting replicated with log-bin=OFF & binlog-format != ROW
This bug is a side-effect of fix for MDEV-6924, where we completely stopped a statement-based event from getting into the binlog cache when binary logging is not enabled (and thus, wsrep_emulate_binlog mode = 1). As a result, the SBR events were not replicated. Fixed by allowing the SBR events to be written into the binlog cache. Note: Only DMLs were affected as DDLs are replicated via TOI. Merged galera_create_trigger.test from github.com/codership/mysql-wsrep.
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc18
1 files changed, 17 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc
index d4403f4dfa4..8b2eb98c2e2 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -5167,7 +5167,19 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate)
binlog_cache_data *cache_data= 0;
bool is_trans_cache= FALSE;
bool using_trans= event_info->use_trans_cache();
- bool direct= event_info->use_direct_logging();
+ bool direct;
+
+#ifdef WITH_WSREP
+ /*
+ When binary logging is not enabled (--log-bin=0), wsrep-patch partially
+ enables it without opening the binlog file (MSQL_BIN_LOG::open().
+ So, avoid writing directly to binlog file.
+ */
+ if (wsrep_emulate_bin_log)
+ direct= false;
+ else
+#endif /* WITH_WSREP */
+ direct= event_info->use_direct_logging();
if (thd->binlog_evt_union.do_union)
{
@@ -5948,6 +5960,10 @@ MYSQL_BIN_LOG::write_transaction_to_binlog(THD *thd,
DBUG_ENTER("MYSQL_BIN_LOG::write_transaction_to_binlog");
#ifdef WITH_WSREP
+ /*
+ Control should not be allowed beyond this point in wsrep_emulate_bin_log
+ mode.
+ */
if (wsrep_emulate_bin_log) DBUG_RETURN(0);
#endif /* WITH_WSREP */
entry.thd= thd;