~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysql-test/include/wait_for_slave_param.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_slave_param.inc
 
2
#
 
3
# SUMMARY
 
4
#
 
5
#    Waits until SHOW SLAVE STATUS has returned a spicified value.
 
6
#
 
7
# USAGE
 
8
#
 
9
#    let $slave_param= Slave_SQL_Running;
 
10
#    let $slave_param_value= No;
 
11
#    --source include/slave_wait_param.inc
 
12
 
 
13
let $slave_wait_param_counter= 300;
 
14
let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
 
15
while (`select "$slave_value" != "$slave_param_value"`)
 
16
{
 
17
  dec $slave_wait_param_counter;
 
18
  if (!$slave_wait_param_counter)
 
19
  {
 
20
    --echo ERROR: failed while waiting for slave parameter $slave_param: $slave_param_value
 
21
    query_vertical show slave status;
 
22
    exit;
 
23
  }
 
24
  sleep 0.1;
 
25
  let $slave_value= query_get_value("SHOW SLAVE STATUS", $slave_param, 1);
 
26
}