12.18 Functions Used with Global Transaction Identifiers (GTIDs)

The functions described in this section are used with GTID-based replication. It is important to keep in mind that all of these functions take string representations of GTID sets as arguments. As such, the GTID sets must always be quoted when used with them. See *note replication-gtids-concepts-gtid-sets:: for more information.

The union of two GTID sets is simply their representations as strings, joined together with an interposed comma. In other words, you can define a very simple function for obtaining the union of two GTID sets, similar to that created here:

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

For more information about GTIDs and how these GTID functions are used in practice, see *note replication-gtids::.

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_FOR_EXECUTED_GTID_SET()'Wait until the given GTIDs have executed on the replica.

'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS()'Use 'WAIT_FOR_EXECUTED_GTID_SET()'.

 File: manual.info.tmp, Node: aggregate-functions-and-modifiers, Next: miscellaneous-functions, Prev: gtid-functions, Up: functions