reset master; CREATE TABLE t1 ( id INT, k INT, c CHAR(8), KEY (k), PRIMARY KEY (id), FOREIGN KEY (id) REFERENCES t1 (k) ) ENGINE=InnoDB; LOCK TABLES t1 WRITE; SET SESSION FOREIGN_KEY_CHECKS= OFF; SET AUTOCOMMIT=OFF; INSERT INTO t1 VALUES (1,1,'foo'); DROP TABLE t1; SET SESSION FOREIGN_KEY_CHECKS= ON; SET AUTOCOMMIT=ON; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; CREATE TABLE t1 ( id INT, k INT, c CHAR(8), KEY (k), PRIMARY KEY (id), FOREIGN KEY (id) REFERENCES t1 (k) ) ENGINE=InnoDB master-bin.000001 # Gtid # # BEGIN GTID #-#-# master-bin.000001 # Annotate_rows # # INSERT INTO t1 VALUES (1,1,'foo') master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Gtid # # GTID #-#-# master-bin.000001 # Query # # use `test`; set foreign_key_checks=1; DROP TABLE `t1` /* generated by server */