include/master-slave.inc [connection master] # # Ensure that read-only slave logs temporary table statements under statement based # replication. This is related to MDEV-17863. # connection slave; set global read_only=1; connection master; create table t1(a int) engine=MyISAM; create temporary table tmp1 (a int) engine=MyISAM; insert into t1 values(1); insert into tmp1 values (2); insert into t1 select * from tmp1; insert into t1 values(3); select * from t1; a 1 2 3 analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK drop table t1; drop temporary table tmp1; connection slave; include/show_binlog_events.inc Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; create table t1(a int) engine=MyISAM slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; create temporary table tmp1 (a int) engine=MyISAM slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; insert into t1 values(1) slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; insert into tmp1 values (2) slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; insert into t1 select * from tmp1 slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # BEGIN GTID #-#-# slave-bin.000001 # Query # # use `test`; insert into t1 values(3) slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; analyze table t1 slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */ slave-bin.000001 # Gtid # # GTID #-#-# slave-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`tmp1` /* generated by server */ set global read_only=0; connection master; include/rpl_end.inc