ndb_autodiscover3.test
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· TEST 代码 · 共 72 行
TEST
72 行
-- source include/have_ndb.inc-- source include/have_multi_ndb.inc-- source include/ndb_default_cluster.inc-- source include/not_embedded.inc--disable_warningsdrop table if exists t1, t2;--enable_warnings# Workaround for Bug#27644# ndb: connecting api node/mysqld may "steal" node_id from running mysqld# - let ndb_waiter use a fixed node id so "steal" cannot happen--let connect_str = "nodeid=6;$NDB_CONNECTSTRING"## Transaction ongoing while cluster is restarted#--connection server1create table t1 (a int key) engine=ndbcluster;begin;insert into t1 values (1);--exec $NDB_MGM --no-defaults -e "all restart" >> $NDB_TOOLS_OUTPUT--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT--error 1297insert into t1 values (2);--error 1296commit;drop table t1;## Stale cache after restart -i#--connection server1create table t2 (a int, b int, primary key(a,b)) engine=ndbcluster;insert into t2 values (1,1),(2,1),(3,1),(4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1);select * from t2 order by a limit 3;--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT--connection server2create table t2 (a int key) engine=ndbcluster;insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);select * from t2 order by a limit 3;# server 1 should have a stale cache, and in this case wrong frm, transaction must be retried--connection server1--error 1015select * from t2 order by a limit 3;select * from t2 order by a limit 3;--exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT--exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults -c $connect_str >> $NDB_TOOLS_OUTPUT--connection server1show tables;create table t2 (a int key) engine=ndbcluster;insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);select * from t2 order by a limit 3;# server 2 should have a stale cache, but with right frm, transaction need not be retried--connection server2select * from t2 order by a limit 3;drop table t2;# End of 4.1 tests
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?