File: ndb_not_readonly.inc

package info (click to toggle)
mysql-5.5 5.5.47-0%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 201,920 kB
  • ctags: 94,437
  • sloc: cpp: 646,401; ansic: 551,652; perl: 53,254; pascal: 25,099; yacc: 13,069; sh: 10,332; cs: 4,647; xml: 4,178; sql: 3,346; makefile: 1,361; lex: 639; awk: 54
file content (36 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Check that server has come out ot readonly mode
#
# wait for server to connect properly to cluster
#

--disable_query_log

set @saved_log = @@sql_log_bin;
set sql_log_bin = 0;
--error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
delete from mysql.ndb_apply_status where server_id=0;
let $mysql_errno= 1;
let $counter= 600;
while ($mysql_errno)
{
  # Table is readonly until the mysqld has connected properly
  --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
  replace into mysql.ndb_apply_status values(0,0,"",0,0);
  if ($mysql_errno)
  {
    if (!$counter)
    {
      die Failed while waiting for mysqld to come out of readonly mode;
    }
    dec $counter;
    --sleep 0.1
  }
}
delete from mysql.ndb_apply_status where server_id=0;
set sql_log_bin = @saved_log;

--enable_query_log

#
# connected
#