Why MySQL GTID not support temporary tables

2k Views Asked by At

I read from MySQL documentation

CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE statements are not supported inside transactions when using GTIDs (that is, when the server was started with the --enforce-gtid-consistency option). It is possible to use these statements with GTIDs enabled, but only outside of any transaction, and only with autocommit=1

and very confused why CREATE/DROP TEMPORARY TABLE not supported inside transactions when GTID is enable, can someone explain in more detail? Thanks!

1

There are 1 best solutions below

0
On

There are reasons most likely relating to replication when GTID is enabled. You can always create a normal table inside a transaction. Drop that table if exists before creating. It will work the same way as temporary table.