Replication and Binary Logging Options and Variables This variable is used to specify whether and how the next GTID is obtained. Setting the session value of this system variable is a restricted operation. The session user must have either the  REPLICATION_APPLIER  privilege (see Section 17.3.3, “Replication Privilege Checks” ), or privileges sufficient to set restricted session variables (see Section 5.1.9.1, “System Variable Privileges” ). gtid_next  can take any of the following values: Exactly which of the above options are valid depends on the setting of  gtid_mode , see Section 17.1.4.1, “Replication Mode Concepts”  for more information. Setting this variable has no effect if gtid_mode  is  OFF . After this variable has been set to  UUID : NUMBER , and a transaction has been committed or rolled back, an explicit  SET GTID_NEXT  statement must again be issued before any other statement. DROP TABLE  or  DROP TEMPORARY TABLE  fails with an explicit error when used on a combination of nontemporary tables with temporary tables, or of temporary tables using transactional storage engines with temporary tables using nontransactional storage engines. This read-only variable is primarily for internal use. Its contents depend on its scope. •When used with global scope,  gtid_owned  holds a list of all the GTIDs that are currently in use on the server, with the IDs of the threads that own them. This variable is mainly useful for a multi- threaded replica to check whether a transaction is already being applied on another thread. An applier thread takes ownership of a transaction’s GTID all the time it is processing the transaction, so  @@global.gtid_owned  shows the GTID and owner for the duration of processing. When a transaction has been committed (or rolled back), the applier thread releases ownership of the GTID. •When used with session scope,  gtid_owned  holds a single GTID that is currently in use by and owned by this session. This variable is mainly useful for testing and debugging the use of GTIDs when the client has explicitly assigned a GTID for the transaction by setting  gtid_next . In this case, @@session.gtid_owned  displays the GTID all the time the client is processing the transaction, 3575 • AUTOMATIC : Use the next automatically-generated global transaction ID. • ANONYMOUS : Transactions do not have global identifiers, and are identified by file and position only. •A global transaction ID in  UUID : NUMBER  format. • gtid_owned Valid Values AUTOMATIC ANONYMOUS UUID:NUMBER System Variable gtid_owned Scope Global, Session Dynamic No SET_VAR  Hint Applies No Type String Unit set of GTIDs