12.15. Functions Used with Global Transaction IDs

The functions described in this section are used with GTID-based replication. For more information about GTIDs and how these functions are used, see Section 16.1.3, "Replication with Global Transaction Identifiers".

Note

The union of two GTID sets is simply their string representations joined together with an interposed comma. In other words, you can define a very simple function for obtaining the union of two GTID sets like this:

CREATE FUNCTION GTID_UNION(g1 TEXT, g2 TEXT)     RETURNS TEXT DETERMINISTICRETURN CONCAT(g1,',',g2);  

Table 12.19. GTID Functions

Name Description
GTID_SUBSET() Return true if all GTIDs in subset are also in set; otherwise false.
GTID_SUBTRACT() Return all GTIDs in set that are not in subset.
WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() Wait until the slave SQL thread has executed all the given GTIDs. Returns: the number of events that were executed (or NULL, if GTID mode is not enabled).




Spec-Zone.ru - all specs in one place