mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / include / connect2.inc
blob6b830a909ed36f68cf969f8c414f3ebdc72ad766
1 # include/connect2.inc
3 # SUMMARY
4
5 #   Make several attempts to connect.
7 # USAGE
9 # EXAMPLE
10
11 #   connect.test
14 --disable_query_log
16 let $wait_counter= 300;
17 if ($wait_timeout)
19   let $wait_counter= `SELECT $wait_timeout * 10`;
21 # Reset $wait_timeout so that its value won't be used on subsequent
22 # calls, and default will be used instead.
23 let $wait_timeout= 0;
25 --echo # -- Establishing connection '$con_name' (user: $con_user_name)...
27 while ($wait_counter)
29     --disable_abort_on_error
30     --disable_result_log
31     --connect ($con_name,localhost,$con_user_name)
32     --enable_result_log
33     --enable_abort_on_error
35     let $error = $mysql_errno;
37     if (!$error)
38     {
39         let $wait_counter= 0;
40     }
41     if ($error)
42     {
43         real_sleep 0.1;
44         dec $wait_counter;
45     }
47 if ($error)
49   --echo # -- Error: can not establish connection '$con_name'.
51 if (!$error)
53   --echo # -- Connection '$con_name' has been established.
56 --enable_query_log