Debian Codegraph @

mysql-test/suite/ndb/t/server_lifecycle.test

raw
1 # Test intentionally uses low timeouts
2 --source include/not_valgrind.inc
3 #
4 # Test MySQL Server lifecycle, ie.
5 # 1. stop/start
6 # 2. stop/start without NDB
7 #
8 --source include/have_ndb.inc
9
10 CREATE TABLE t1 (
11 a INT PRIMARY KEY,
12 b VARCHAR(32)
13 ) engine=ndb;
14
15 INSERT INTO t1 VALUES (1, "row 1");
16
17 SELECT a FROM t1;
18
19 --echo #
20 --echo # 1. stop/start
21 --echo #
22
23 --echo # Restart MySQL Server
24 --let $mysqld_name=mysqld.1.1
25 --source include/restart_mysqld.inc
26
27 --source include/ndb_not_readonly.inc
28
29 SELECT a FROM t1;
30
31 --echo #
32 --echo # 2. stop/start without NDB
33 --echo #
34
35 # Supress warning from Server starting up without NDB
36 call mtr.add_suppression("Tables not available after [0-9]* seconds");
37
38 --echo # Stop data nodes
39 --exec $NDB_MGM -e "all restart -n"
40 --exec $NDB_WAITER --not-started 2>&1 > /dev/null
41
42 --echo # Error since data nodes are down
43 --error ER_GET_ERRMSG
44 SELECT a FROM t1;
45
46 --echo # Restart MySQL Server (with data nodes in no start)
47 --let $mysqld_name=mysqld.1.1
48 --source include/restart_mysqld.inc
49
50 --echo # Error since data nodes are still down
51 --error ER_GET_ERRMSG
52 SELECT a FROM t1;
53
54 --echo # Start data nodes again
55 --exec $NDB_MGM -e "all start"
56 --exec $NDB_WAITER 2>&1 > /dev/null
57
58 --source include/ndb_not_readonly.inc
59
60 SELECT a FROM t1;
61
62 DROP TABLE t1;