summaryrefslogtreecommitdiff
path: root/sql/rpl_gtid.cc
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-08-22 12:36:42 +0200
committerunknown <knielsen@knielsen-hq.org>2013-08-22 12:36:42 +0200
commitf74c745a994cbbf3b8289674bf49629224457d4e (patch)
treed1cd1df1a0bf6004428683af6dd83cc7b5b55937 /sql/rpl_gtid.cc
parent33c66eb7fbcddb09217820708e8ce9324e65db11 (diff)
downloadmariadb-git-f74c745a994cbbf3b8289674bf49629224457d4e.tar.gz
MDEV-4488: When master is on the list of ignore_server_ids, GTID position on slave is not updated
The ignored events are not written to the relay log, but instead a fake Rotate event is generated to handle update of position. Extend this for Gtid so we similarly generate a fake Gtid_list event to update the GTID position. Also fix an unrelated test issue that got triggered by the added test cases.
Diffstat (limited to 'sql/rpl_gtid.cc')
-rw-r--r--sql/rpl_gtid.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index c8a00cd78ae..96dade4d390 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -1419,6 +1419,15 @@ slave_connection_state::remove(const rpl_gtid *in_gtid)
}
+void
+slave_connection_state::remove_if_present(const rpl_gtid *in_gtid)
+{
+ uchar *rec= my_hash_search(&hash, (const uchar *)(&in_gtid->domain_id), 0);
+ if (rec)
+ my_hash_delete(&hash, rec);
+}
+
+
int
slave_connection_state::to_string(String *out_str)
{
@@ -1442,3 +1451,22 @@ slave_connection_state::append_to_string(String *out_str)
}
return 0;
}
+
+
+int
+slave_connection_state::get_gtid_list(rpl_gtid *gtid_list, uint32 list_size)
+{
+ uint32 i, pos;
+
+ pos= 0;
+ for (i= 0; i < hash.records; ++i)
+ {
+ entry *e;
+ if (pos >= list_size)
+ return 1;
+ e= (entry *)my_hash_element(&hash, i);
+ memcpy(&gtid_list[pos++], &e->gtid, sizeof(e->gtid));
+ }
+
+ return 0;
+}