Syntax:
WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(gtid_set[, timeout][,channel])

Wait until the slave SQL thread has executed all of the transactions
whose global transaction identifiers are contained in gtid_set (see
http://dev.mysql.com/doc/refman/5.7/en/replication-gtids-concepts.html,
for a definition of "GTID sets"), or until timeout seconds have
elapsed, whichever occurs first. timeout is optional; the default
timeout is 0 seconds, in which case the function waits until all of the
transactions in the GTID set have been executed.

For more information, see
http://dev.mysql.com/doc/refman/5.7/en/replication-gtids.html.

URL: http://dev.mysql.com/doc/refman/5.7/en/gtid-functions.html

