diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-05-15 19:52:21 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-05-15 19:52:21 +0200 |
commit | 9fae9930244d505585d83590051a17df9bab7d8a (patch) | |
tree | 8d03f56b634a5f11d47c83200128dc81071833e5 /sql/rpl_gtid.cc | |
parent | 7202c21b343c14d0f1fc868fc7789486338a656f (diff) | |
download | mariadb-git-9fae9930244d505585d83590051a17df9bab7d8a.tar.gz |
MDEV-26: Global transaction ID.
Implement START SLAVE UNTIL master_gtid_pos = "<GTID position>".
Add test cases, including a test showing how to use this to promote
a new master among a set of slaves.
Diffstat (limited to 'sql/rpl_gtid.cc')
-rw-r--r-- | sql/rpl_gtid.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index bda060115ed..a4bdeb9932b 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -711,6 +711,22 @@ void rpl_binlog_state::free() } } + +bool +rpl_binlog_state::load(struct rpl_gtid *list, uint32 count) +{ + uint32 i; + + reset(); + for (i= 0; i < count; ++i) + { + if (update(&(list[i]))) + return true; + } + return false; +} + + rpl_binlog_state::~rpl_binlog_state() { free(); @@ -1117,10 +1133,17 @@ slave_connection_state::remove(const rpl_gtid *in_gtid) int slave_connection_state::to_string(String *out_str) { + out_str->length(0); + return append_to_string(out_str); +} + + +int +slave_connection_state::append_to_string(String *out_str) +{ uint32 i; bool first; - out_str->length(0); first= true; for (i= 0; i < hash.records; ++i) { |