mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
5c78f82915
mysql-test/suite/rpl/r/rpl_flushlog_loop.result: updated result mysql-test/suite/rpl/r/rpl_row_view01.result: updated result mysql-test/suite/rpl/t/rpl_change_master.test: replace sleep mysql-test/suite/rpl/t/rpl_drop_temp.test: replace sleep mysql-test/suite/rpl/t/rpl_flushlog_loop.test: replace sleep mysql-test/suite/rpl/t/rpl_relayspace.test: replace waiting of state to wait_for_slave_param.inc mysql-test/suite/rpl/t/rpl_row_view01.test: replace sleep mysql-test/suite/rpl/t/rpl_trunc_temp.test: replace sleep mysql-test/include/wait_for_binlog_event.inc: New primitive: waiting an event in binlog on master
33 lines
806 B
PHP
33 lines
806 B
PHP
# include/wait_for_binlog_event.inc
|
|
#
|
|
# SUMMARY
|
|
#
|
|
# Waits until SHOW BINLOG EVENTS has returned in last event a specified substring.
|
|
#
|
|
# USAGE
|
|
#
|
|
# let $wait_binlog_event= DROP;
|
|
# --source include/wait_for_binlog_event.inc
|
|
|
|
let $_loop_count= 300;
|
|
let $_last_event= ;
|
|
let $_event_pos= 1;
|
|
|
|
while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`)
|
|
{
|
|
dec $_loop_count;
|
|
if (!$_loop_count)
|
|
{
|
|
SHOW BINLOG EVENTS;
|
|
--die ERROR: failed while waiting for $wait_binlog_event in binlog
|
|
}
|
|
real_sleep 0.1;
|
|
let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
|
|
let $_last_event= $_event;
|
|
while (`SELECT "$_event" != "No such row"`)
|
|
{
|
|
inc $_event_pos;
|
|
let $_last_event= $_event;
|
|
let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
|
|
}
|
|
}
|