source include/master-slave.inc; source include/have_binlog_format_statement.inc; call mtr.add_suppression("Unsafe statement written to the binary log"); CREATE TABLE t1 (a int); send INSERT INTO t1 VALUES(SLEEP(2)); connection slave; let $run = 10; while ($run) { dec $run; let $sbm=query_get_value(SHOW SLAVE STATUS, Seconds_Behind_Master, 1); # for debugging uncomment echo and remove the if() #echo Seconds_Behind_Master: $sbm; if ($sbm) { let $run = 0; } sleep 0.5; } echo Seconds_Behind_Master: $sbm; connection master; reap; drop table t1; source include/rpl_end.inc;