Description:
http://dev.mysql.com/doc/refman/5.6/en/replication-gtids-restrictions.html claims "CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE statements are not supported when using GTIDs", yet I have no problem at all executing either of those statements with gtid_mode=ON, using either "row" or "statement" binlog_format, as long as they're executed *outside* of an explicit transaction.
How to repeat:
commit;
set autocommit=1;
create temporary table temp1 (id int) engine=innodb;
drop temporary table temp1;
begin;
create temporary table temp1 (id int) engine=innodb;
rollback;
begin;
drop temporary table temp1;
rollback;
box1> commit;
Query OK, 0 rows affected (0.00 sec)
box1> set autocommit=1;
Query OK, 0 rows affected (0.00 sec)
box1> create temporary table temp1 (id int) engine=innodb;
Query OK, 0 rows affected (0.01 sec)
box1> drop temporary table temp1;
Query OK, 0 rows affected (0.00 sec)
box1>
box1> begin;
Query OK, 0 rows affected (0.00 sec)
box1> create temporary table temp1 (id int) engine=innodb;
ERROR 1787 (HY000): When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.
box1> rollback;
Query OK, 0 rows affected (0.00 sec)
box1>
box1> begin;
Query OK, 0 rows affected (0.00 sec)
box1> drop temporary table temp1;
ERROR 1787 (HY000): When ENFORCE_GTID_CONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.
box1> rollback;
Query OK, 0 rows affected (0.00 sec)
Suggested fix:
The documentation should state "CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE statements are not supported inside transactions when using GTIDs" and should clarify that they *are* allowed when *not* used inside transactions.
The page then goes on to say "While it is possible to execute these statements inside a transaction", which doesn't seem to be true, so that should be changed as well.