MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_not_readonly.inc
1 # Check that server has come out ot readonly mode
2 #
3 # wait for server to connect properly to cluster
4 #
5 
6 --disable_query_log
7 
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_TABLE_DEF_CHANGED,ER_NOT_FORM_FILE,ER_KEY_NOT_FOUND
11 delete from mysql.ndb_schema where db="" and name="";
12 let $mysql_errno= 1;
13 let $counter= 600;
14 while ($mysql_errno)
15 {
16  # Table is readonly until the mysqld has connected properly
17  --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_TABLE_DEF_CHANGED,ER_NOT_FORM_FILE,
18  replace into mysql.ndb_schema values("","",0,"",0,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  }
28 }
29 delete from mysql.ndb_schema where db="" and name="";
30 set sql_log_bin = @saved_log;
31 
32 --enable_query_log
33 
34 #
35 # connected
36 #