Syntax:
WAIT_FOR_EXECUTED_GTID_SET(gtid_set[, timeout])

Introduced in MySQL 5.7.5, WAIT_FOR_EXECUTED_GTID_SET() is similar to
WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS() in that it waits until a server has
executed all of the transactions whose global transaction identifiers
are contained in gtid_set, or until timeout seconds have elapsed,
whichever occurs first. Unlike WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS(),
WAIT_FOR_EXECUTED_GTID_SET() does not take into account whether the
slave is running or not, and an error is returned if GTID-based
replication is not enabled.

In addition, WAIT_FOR_EXECUTED_GTID_SET() returns only the state of the
query, where 0 represents success, 1 represents timeout, and any other
failures return the error message.

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

