summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-02-15 17:06:01 +0100
committerunknown <knielsen@knielsen-hq.org>2013-02-15 17:06:01 +0100
commitbfa3f15416c5e5237871cc8e16ca539de27ed315 (patch)
treebc2ae5d21b8f550e89415ee022f223b0bc0b7c08 /sql/slave.cc
parent1c6271b36a8a8b85e5af87915fc5d680e2c10575 (diff)
downloadmariadb-git-bfa3f15416c5e5237871cc8e16ca539de27ed315.tar.gz
MDEV-26: Global Transaction ID.
Fix things so that GTID state on slave is updated also for non-XID event groups (ie. DDL and MyISAM DML).
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 33455986008..3c98ecf3639 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -5151,8 +5151,25 @@ MYSQL *rpl_connect_master(MYSQL *mysql)
bool flush_relay_log_info(Relay_log_info* rli)
{
bool error=0;
+ uint64 sub_id;
+ rpl_gtid gtid;
DBUG_ENTER("flush_relay_log_info");
+ /*
+ Update the GTID position, if we have it and did not already update
+ it in a GTID transaction.
+ */
+ if ((sub_id= rli->gtid_sub_id))
+ {
+ rli->gtid_sub_id= 0;
+ gtid= rli->current_gtid;
+ if (rpl_global_gtid_slave_state.record_gtid(rli->sql_thd,
+ &gtid, sub_id, false))
+ error= 1;
+ else
+ update_slave_gtid_state_hash(sub_id, &gtid);
+ }
+
if (unlikely(rli->no_storage))
DBUG_RETURN(0);