MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
wait_time_until_connected_again.inc
1 #
2 # Include this script to wait until the connection to the
3 # server has been restored or timeout occurs
4 # Unlike wait_until_connected_again the variable counter must be set outside as var.
5 # set WAIT_COUNT before executinmg this include file.
6 --disable_result_log
7 --disable_query_log
8 let $counter= $WAIT_COUNT;
9 let $mysql_errno= 9999;
10 while ($mysql_errno)
11 {
12  # Strangely enough, the server might return "Too many connections"
13  # while being shutdown, thus 1040 is an "allowed" error
14  # See BUG#36228
15  --error 0,1040,1053,2002,2003,2006,2013
16  show status;
17 
18  dec $counter;
19  if (!$counter)
20  {
21  --echo Waited $WAIT_COUNT * 0.5 sec.
22  --die Server failed to restart
23  }
24  --sleep 0.5
25 }
26 --enable_query_log
27 --enable_result_log