content_image/818838.jpg
are removed by a filter, GTID consistency is not checked or enforced for the statements that are not logged. 

For information about other required startup options when enabling GTIDs, see Section 17.1.3.4, “Setting Up Replication Using GTIDs” . 

Skipping transactions. sql_slave_skip_counter  is not available when using GTID- based replication. If you need to skip transactions, use the value of the source’s gtid_executed variable instead. If you have enabled GTID assignment on a replication channel using the ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS  option of the CHANGE REPLICATION SOURCE TO  statement, sql_slave_skip_counter  is available. For more information, see Section 17.1.7.3, “Skipping Transactions” . 

Ignoring servers.  The IGNORE_SERVER_IDS option of the CHANGE REPLICATION SOURCE TO  | CHANGE MASTER TO  statement is deprecated when using GTIDs, because transactions that have already been applied are automatically ignored. Before starting GTID-based replication, check for and clear all ignored server ID lists that have previously been set on the servers involved. The SHOW REPLICA | SLAVE STATUS  statement, which can be issued for individual channels, displays the list of ignored server IDs if there is one. If there is no list, the Replicate_Ignore_Server_Ids  field is blank. 

GTID mode and mysql_upgrade.  Prior to MySQL 8.0.16, when the server is running with global transaction identifiers (GTIDs) enabled ( gtid_mode=ON ), do not enable binary logging by mysql_upgrade  (the --write-binlog  option). As of MySQL 8.0.16, the server performs the entire MySQL upgrade procedure, but disables binary logging during the upgrade, so there is no issue. 

## 17.1.3.8 Stored Function Examples to Manipulate GTIDs 

MySQL includes some built-in (native) functions for use with GTID-based replication. These functions are as follows: 

<img src='content_image/818838.jpg'>

For details of these functions, see Section 12.19, “Functions Used with Global Transaction Identifiers (GTIDs)” . 

You can define your own stored functions to work with GTIDs. For information on defining stored functions, see Chapter 25, Stored Objects . The following examples show some useful stored functions that can be created based on the built-in GTID_SUBSET()  and GTID_SUBTRACT()  functions. 

Note that in these stored functions, the delimiter command has been used to change the MySQL statement delimiter to a vertical bar, as follows: 

mysql> delimiter | 

All of these functions take string representations of GTID sets as arguments, so GTID sets must always be quoted when used with them. 

