1
- -- source include/have_ndb.inc
2
1
-- source include/have_multi_ndb.inc
3
2
-- source include/ndb_default_cluster.inc
4
3
-- source include/not_embedded.inc
10
9
drop table if exists t1, t2;
11
10
--enable_warnings
12
11
12
+ connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
13
+ connect (con2,127.0.0.1,root,,test,$MASTER_MYPORT1,);
14
+
13
15
# Workaround for Bug#27644
14
16
# ndb: connecting api node/mysqld may "steal" node_id from running mysqld
15
17
# - let ndb_waiter use a fixed node id so "steal" cannot happen
@@ -27,8 +29,14 @@ insert into t1 values (1);
27
29
--exec $NDB_MGM --no-defaults -e "all restart" >> $NDB_TOOLS_OUTPUT
28
30
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
29
31
# Wait for mysqld to reconnect and exit from readonly mode
30
- # Should preferrably be a "while (!"select ndb_readonly")" loop
31
- sleep 2;
32
+ --disable_query_log
33
+ --connection con1
34
+ --source include/ndb_not_readonly.inc
35
+ --connection con2
36
+ --source include/ndb_not_readonly.inc
37
+ --enable_query_log
38
+
39
+ --connection server1
32
40
--error 1297
33
41
insert into t1 values (2);
34
42
--error 1296
@@ -47,8 +55,13 @@ select * from t2 order by a limit 3;
47
55
--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
48
56
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
49
57
# to ensure mysqld has connected again, and recreated system tables
50
- --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster ndb_apply_status >> $NDB_TOOLS_OUTPUT
51
- sleep 2;
58
+ --disable_query_log
59
+ --connection con1
60
+ --source include/ndb_not_readonly.inc
61
+ --connection con2
62
+ --source include/ndb_not_readonly.inc
63
+ --enable_query_log
64
+
52
65
--connection server2
53
66
--error ER_NO_SUCH_TABLE
54
67
select * from t2;
@@ -66,8 +79,13 @@ reset master;
66
79
--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
67
80
--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT
68
81
# to ensure mysqld has connected again, and recreated system tables
69
- --exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster ndb_apply_status >> $NDB_TOOLS_OUTPUT
70
- sleep 2;
82
+ --disable_query_log
83
+ --connection con1
84
+ --source include/ndb_not_readonly.inc
85
+ --connection con2
86
+ --source include/ndb_not_readonly.inc
87
+ --enable_query_log
88
+
71
89
--connection server1
72
90
--error ER_NO_SUCH_TABLE
73
91
select * from t2;
0 commit comments