I have a sql script that contains the statement create tbl2 as select * from tbl;
This statement works on a docker mysql with version 5.7 (currently 5.7.19), even though enforce-gtid-consistency is turned on. Relevant lines from the docker compose yml are:
image: mysql:5.7
command: --gtid-mode=ON --enforce-gtid-consistency=true
This is even though the documentation clearly specifies:
Since only transactionally safe statements can be logged when --enforce-gtid-consistency is enabled, it follows that the operations listed here cannot be used with this option:
CREATE TABLE ... SELECT statements
The same statement fails with ERROR 1786 (HY000): Statement violates GTID consistency: CREATE TABLE ... SELECT. on a google cloud mysql instance.
show variables like '%gtid%' returns the same result on the docker mysql and the google cloud instance (and enforce_gtid_consistency is on in both).