Spec-Zone .ru
спецификации, руководства, описания, API

12.15. GTID Functions

The functions described in this section are used with GTID-based replication (available in MySQL 5.6.5 and later). 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.
SQL_THREAD_WAIT_AFTER_GTIDS()(deprecated 5.6.9) OBSOLETE: Replaced by WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS()
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).