summaryrefslogtreecommitdiff
path: root/sql/sql_binlog.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2011-08-11 11:38:52 +0200
committerunknown <knielsen@knielsen-hq.org>2011-08-11 11:38:52 +0200
commitc4d69f17753f375e8cfd18c33de291cdf13504f9 (patch)
tree4122550e2bd9b38209eb2b9f86c0421f68e70571 /sql/sql_binlog.cc
parent51c7723eb2faf7bb9de8d0a2a3b364b07f82b0fd (diff)
downloadmariadb-git-c4d69f17753f375e8cfd18c33de291cdf13504f9.tar.gz
MWL#234: Support for marking binlog events to not be replicated, and for telling slaves not to replicate events with such mark
Diffstat (limited to 'sql/sql_binlog.cc')
-rw-r--r--sql/sql_binlog.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_binlog.cc b/sql/sql_binlog.cc
index 9713ec1ef5c..bb95054a371 100644
--- a/sql/sql_binlog.cc
+++ b/sql/sql_binlog.cc
@@ -33,6 +33,7 @@
void mysql_client_binlog_statement(THD* thd)
{
+ ulonglong save_do_not_replicate;
DBUG_ENTER("mysql_client_binlog_statement");
DBUG_PRINT("info",("binlog base64: '%*s'",
(int) (thd->lex->comment.length < 2048 ?
@@ -213,7 +214,15 @@ void mysql_client_binlog_statement(THD* thd)
reporting.
*/
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
+ save_do_not_replicate= thd->options & OPTION_DO_NOT_REPLICATE;
+ thd->options= (thd->options & ~OPTION_DO_NOT_REPLICATE) |
+ (ev->flags & LOG_EVENT_DO_NOT_REPLICATE_F ?
+ OPTION_DO_NOT_REPLICATE : 0);
+
err= ev->apply_event(rli);
+
+ thd->options= (thd->options & ~OPTION_DO_NOT_REPLICATE) |
+ save_do_not_replicate;
#else
err= 0;
#endif