1# Include this script after a shutdown to wait until the connection
2# to the server has been lost or timeout occurs.
3# When you change this file you may have to chance its cousin
4# wait_until_connected_again.inc
5
6--disable_result_log
7--disable_query_log
8let $counter= 600;
9let $mysql_errno= 0;
10while (!$mysql_errno)
11{
12  --error 0,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,2002,2006,2013
13  show status;
14
15  dec $counter;
16  if (!$counter)
17  {
18    --die Server failed to disappear
19  }
20  --real_sleep 0.1
21}
22--enable_query_log
23--enable_result_log
24