~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

Viewing changes to mysql-test/include/wait_for_slave_to_start.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
###################################################
 
2
#Author: Jeb
 
3
#Date: 2007-06-11
 
4
#Purpose: To wait a brief time for slave to start
 
5
#Details:
 
6
#      1) Fill in and setup variables
 
7
#      2) loop through looking for both
 
8
#         io and sql threads to start
 
9
#      3) If loops too long die.
 
10
####################################################
 
11
connection slave;
 
12
let $row_number= 1;
 
13
let $run= 1;
 
14
let $counter= 300;
 
15
 
 
16
while ($run)
 
17
{
 
18
  let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
 
19
  if (`SELECT '$io_result' = 'Yes'`){
 
20
 
 
21
    let $sql_result= query_get_value("SHOW SLAVE STATUS",  Slave_SQL_Running, $row_number);
 
22
    if (`SELECT '$sql_result' = 'Yes'`){
 
23
      let $run= 0;
 
24
    }
 
25
  }
 
26
  sleep 0.1;
 
27
  if (!$counter){
 
28
    --echo "Failed while waiting for slave to start"
 
29
    query_vertical SHOW SLAVE STATUS;
 
30
    exit;
 
31
  }
 
32
  dec $counter;
 
33
}
 
34
 
 
35