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

• GTID_SUBSET( set1 , set2 ) 

Given two sets of global transaction identifiers set1  and set2 , returns true if all GTIDs in set1  are also in set2 . Returns false otherwise. 

The GTID sets used with this function are represented as strings, as shown in the following examples: 

mysql> SELECT GTID_SUBSET(’3E11FA47-71CA-11E1-9E33-C80AA9429562:23’, -> ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’)\G *************************** 1. row *************************** GTID_SUBSET(’3E11FA47-71CA-11E1-9E33-C80AA9429562:23’, ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’): 1 1 row in set (0.00 sec) mysql> SELECT GTID_SUBSET(’3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25’, -> ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’)\G *************************** 1. row *************************** GTID_SUBSET(’3E11FA47-71CA-11E1-9E33-C80AA9429562:23-25’, ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’): 1 1 row in set (0.00 sec) mysql> SELECT GTID_SUBSET(’3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25’, -> ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’)\G *************************** 1. row *************************** GTID_SUBSET(’3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25’, ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’): 0 1 row in set (0.00 sec) 

• GTID_SUBTRACT( set1 , set2 ) 

Given two sets of global transaction identifiers set1  and set2 , returns only those GTIDs from set1  that are not in set2 . 

All GTID sets used with this function are represented as strings and must be quoted, as shown in these examples: 

mysql> SELECT GTID_SUBTRACT(’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’, -> ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21’)\G *************************** 1. row *************************** GTID_SUBTRACT(’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’, ’3E11FA47-71CA-11E1-9E33-C80AA9429562:21’): 3e11fa47-71ca-11e1-9e33-c80aa9429562:22-57 1 row in set (0.00 sec) mysql> SELECT GTID_SUBTRACT(’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’, -> ’3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25’)\G *************************** 1. row *************************** GTID_SUBTRACT(’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’, ’3E11FA47-71CA-11E1-9E33-C80AA9429562:20-25’): 3e11fa47-71ca-11e1-9e33-c80aa9429562:26-57 1 row in set (0.00 sec) mysql> SELECT GTID_SUBTRACT(’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’, -> ’3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24’)\G *************************** 1. row *************************** GTID_SUBTRACT(’3E11FA47-71CA-11E1-9E33-C80AA9429562:21-57’, ’3E11FA47-71CA-11E1-9E33-C80AA9429562:23-24’): 3e11fa47-71ca-11e1-9e33-c80aa9429562:21-22:25-57 1 row in set (0.01 sec) 

