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.
This commit is contained in:
unknown 2013-05-15 19:52:21 +02:00
commit 9fae993024
19 changed files with 1824 additions and 147 deletions

View file

@ -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();
@ -1116,11 +1132,18 @@ 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)
{