1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-26: Global transaction ID.

Move combining slave and gtid binlog state into a separate function.

Make SHOW ALL SLAVES STATUS use the same function, so it shows the
same value used by slave connect.

Add a test case.
This commit is contained in:
unknown
2013-04-04 17:38:10 +02:00
parent bdf6367d0e
commit c2cbc9cee6
5 changed files with 116 additions and 21 deletions

View File

@@ -3360,4 +3360,30 @@ rpl_deinit_gtid_slave_state()
rpl_global_gtid_slave_state.deinit();
}
/*
Format the current GTID state as a string, for use when connecting to a
master server with GTID, or for returning the value of @@global.gtid_state.
If the flag use_binlog is true, then the contents of the binary log (if
enabled) is merged into the current GTID state.
*/
int
rpl_append_gtid_state(String *dest, bool use_binlog)
{
int err;
rpl_gtid *gtid_list= NULL;
uint32 num_gtids= 0;
if (opt_bin_log &&
(err= mysql_bin_log.get_most_recent_gtid_list(&gtid_list, &num_gtids)))
return err;
rpl_global_gtid_slave_state.tostring(dest, gtid_list, num_gtids);
my_free(gtid_list);
return 0;
}
#endif /* HAVE_REPLICATION */