~drizzle-trunk/drizzle/development

1 by brian
clean slate
1
###################################################
2
#Author: Jeb
3
#Date: 2007-06-11
4
#Purpose: used for SQL errors on the slave. If Slave gets a sql
5
#         error, the SQL trhead should stop
6
#Details:
7
#      1) Fill in and setup variables
8
#      2) loop through looking for
9
#         sql threads to stop
10
#      3) If loops too long die.
11
####################################################
12
if (!$keep_connection)
13
{
14
  connection slave;
15
}
16
let $row_number= 1;
17
let $run= 1;
18
let $counter= 300;
19
20
while ($run)
21
{
22
  let $sql_result= query_get_value("SHOW SLAVE STATUS", Slave_SQL_Running, $row_number);
23
  if (`SELECT '$sql_result' = 'No'`){
24
    let $run= 0;
25
  }
26
  sleep 0.1;
27
  if (!$counter){
28
    --echo "Failed while waiting for slave SQL thread to stop"
29
    query_vertical SHOW SLAVE STATUS;
30
    exit;
31
  }
32
  dec $counter;
33
}