~jlukas79/+junk/mysql-server

« back to all changes in this revision

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

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###################################################
 
2
#Author:  Mats (based on file written by Jeb)
 
3
#Date:    2008-05-06
 
4
#Purpose: To wait for slave SQL thread 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 $sql_result= query_get_value("SHOW SLAVE STATUS",  Slave_SQL_Running, $row_number);
 
19
  if (`SELECT '$sql_result' = 'Yes'`){
 
20
    let $run= 0;
 
21
  }
 
22
  sleep 0.1;
 
23
  if (!$counter){
 
24
    --echo "Failed while waiting for slave SQL to start"
 
25
    query_vertical SHOW SLAVE STATUS;
 
26
    exit;
 
27
  }
 
28
  dec $counter;
 
29
}
 
30
 
 
31