~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/include/wait_for_binlog_event.inc

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# include/wait_for_binlog_event.inc
 
2
#
 
3
# SUMMARY
 
4
#
 
5
#    Waits until SHOW BINLOG EVENTS has returned in last event a specified substring.
 
6
#
 
7
# USAGE
 
8
#
 
9
#    let $wait_binlog_event= DROP;
 
10
#    --source include/wait_for_binlog_event.inc
 
11
 
 
12
let $_loop_count= 300;
 
13
let $_last_event= ;
 
14
let $_event_pos= 1;
 
15
 
 
16
while (`SELECT INSTR("$_last_event","$wait_binlog_event") = 0`)
 
17
{
 
18
  dec $_loop_count;
 
19
  if (!$_loop_count)
 
20
  {
 
21
    SHOW BINLOG EVENTS;
 
22
    --die ERROR: failed while waiting for $wait_binlog_event in binlog 
 
23
  }
 
24
  real_sleep 0.1;
 
25
  let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
 
26
  let $_last_event= $_event;
 
27
  while (`SELECT "$_event" != "No such row"`)
 
28
  {
 
29
    inc $_event_pos;
 
30
    let $_last_event= $_event;
 
31
    let $_event= query_get_value(SHOW BINLOG EVENTS, Info, $_event_pos);
 
32
  }
 
33
}