1#
2# Include this script to wait until the connection to the
3# server has been restored or timeout occurs.
4# You should have done --enable_reconnect first
5# When you change this file you may have to chance its cousin
6# wait_until_disconnected.inc
7
8--disable_result_log
9--disable_query_log
10let $counter= 5000;
11let $mysql_errno= 9999;
12while ($mysql_errno)
13{
14  --error 0,ER_ACCESS_DENIED_ERROR,ER_SERVER_SHUTDOWN,ER_CONNECTION_KILLED,ER_LOCK_WAIT_TIMEOUT,2002,2006,2013
15  show status;
16
17  dec $counter;
18  if (!$counter)
19  {
20    --die Server failed to restart
21  }
22  if (!$mysql_errno)
23  {
24    # WSREP: SHOW STATUS queries are allowed even if wsrep
25    #        is not ready. Make sure wsrep is ready before
26    #        returning from this script
27    source include/wait_wsrep_ready.inc;
28  }
29  if ($mysql_errno == 1045)
30  {
31    let $mysql_errno=0;
32  }
33  --sleep 0.1
34}
35--enable_query_log
36--enable_result_log
37