~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/include/ndb_not_readonly.inc

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Check that server has come out ot readonly mode
 
2
#
 
3
# wait for server to connect properly to cluster
 
4
#
 
5
set @saved_log = @@sql_log_bin;
 
6
set sql_log_bin = 0;
 
7
--error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG,ER_KEY_NOT_FOUND
 
8
delete from mysql.ndb_apply_status where server_id=0;
 
9
let $mysql_errno= 1;
 
10
let $counter= 600;
 
11
while ($mysql_errno)
 
12
{
 
13
  # Table is readonly until the mysqld has connected properly
 
14
  --error 0,ER_NO_SUCH_TABLE,ER_OPEN_AS_READONLY,ER_GET_ERRMSG
 
15
  replace into mysql.ndb_apply_status values(0,0,"",0,0);
 
16
  if ($mysql_errno)
 
17
  {
 
18
    if (!$counter)
 
19
    {
 
20
      die Failed while waiting for mysqld to come out of readonly mode;
 
21
    }
 
22
    dec $counter;
 
23
    --sleep 0.1
 
24
  }
 
25
}
 
26
delete from mysql.ndb_apply_status where server_id=0;
 
27
set sql_log_bin = @saved_log;
 
28
#
 
29
# connected
 
30
#