mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / include / ndb_not_readonly.inc
blobebb343bb18da073092dea9b49528de558f7f37e3
1 # Check that server has come out ot readonly mode
3 # wait for server to connect properly to cluster
6 --disable_query_log
8 set @saved_log = @@sql_log_bin;
9 set sql_log_bin = 0;
10 --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
11 delete from mysql.ndb_apply_status where server_id=0;
12 let $mysql_errno= 1;
13 let $counter= 600;
14 while ($mysql_errno)
16   # Table is readonly until the mysqld has connected properly
17   --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
18   replace into mysql.ndb_apply_status values(0,0,"",0,0);
19   if ($mysql_errno)
20   {
21     if (!$counter)
22     {
23       die Failed while waiting for mysqld to come out of readonly mode;
24     }
25     dec $counter;
26     --sleep 0.1
27   }
29 delete from mysql.ndb_apply_status where server_id=0;
30 set sql_log_bin = @saved_log;
32 --enable_query_log
35 # connected