~stewart/drizzle/embedded-innodb-create-select-transaction-arrgh

« back to all changes in this revision

Viewing changes to mysql-test/include/wait_for_slave_io_to_stop.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: used for io errors on the slave. If Slave gets an io
 
5
#         error, the io 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
connection slave;
 
13
let $my_show= SHOW SLAVE STATUS;
 
14
let $sql_running= Slave_IO_Running;
 
15
let $row_number= 1;
 
16
let $run= 1;
 
17
let $counter= 300;
 
18
 
 
19
while ($run)
 
20
{
 
21
  let $io_result= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, $row_number);
 
22
  if (`SELECT '$io_result' = 'No'`){
 
23
    let $run= 0;
 
24
  }
 
25
  sleep 0.1;
 
26
  if (!$counter){
 
27
    --echo "Failed while waiting for slave IO thread to stop"
 
28
    query_vertical SHOW SLAVE STATUS;
 
29
    exit;
 
30
  }
 
31
  dec $counter;
 
32
}
 
33