-- source include/have_ndb.inc -- source have_ndb_error_insert.inc # Ignore the warning generated by ndbcluster's binlog thread # when cluster is restarted --disable_query_log ONCE call mtr.add_suppression("cluster disconnect An incident event has been written"); # Ignore the warning generated by ndbcluster's binlog thread # when cluster is restarted - also on the second mysqld connect(mysqld2,127.0.0.1,root,,test,$MASTER_MYPORT1); connection mysqld2; --disable_query_log ONCE call mtr.add_suppression("cluster disconnect An incident event has been written"); connection default; --let $KEYS=40 use test; --echo Test read-locality of READ-BACKUP create table test.t1 (a int primary key, b int, c int, d int, unique(b) using hash, key(c), key(a,c)) comment="NDB_TABLE=READ_BACKUP=1" engine=ndb; create table test.t2 (a int primary key, b int, c int, d text, unique(b) using hash, key(c)) comment="NDB_TABLE=READ_BACKUP=1" engine=ndb; --source ndb_read_local.inc drop table test.t1; drop table test.t2; --echo Test read-locality after ALTER TABLE into READ-BACKUP create table test.t1 (a int primary key, b int, c int, d int, unique(b) using hash, key(c), key(a,c)) engine=ndb; create table test.t2 (a int primary key, b int, c int, d text, unique(b) using hash, key(c)) engine=ndb; alter table t1 algorithm=inplace, comment="NDB_TABLE=READ_BACKUP=1"; alter table t2 algorithm=inplace, comment="NDB_TABLE=READ_BACKUP=1"; let $ndb_desc_opts= -b -i -d test t2; source suite/ndb/include/ndb_desc_print.inc; --source ndb_read_local.inc --exec $NDB_MGM --no-defaults --verbose=0 -e "all restart" --source include/ndb_not_readonly.inc let $ndb_desc_opts= -b -i -d test t2; source suite/ndb/include/ndb_desc_print.inc; --source ndb_read_local.inc drop table test.t1; drop table test.t2; --echo Test read-locality of FULLY-REPLICATED create table test.t1 (a int primary key, b int, c int, d int, unique(b) using hash, key(c), key(a,c)) comment="NDB_TABLE=FULLY_REPLICATED=1" engine=ndb; create table test.t2 (a int primary key, b int, c int, d text, unique(b) using hash, key(c)) comment="NDB_TABLE=FULLY_REPLICATED=1" engine=ndb; --source ndb_read_local.inc --exec $NDB_MGM --verbose=0 -e'create nodegroup 3,4' alter table t1 algorithm=inplace, reorganize partition; alter table t2 algorithm=inplace, reorganize partition; --source ndb_read_local.inc --exec $NDB_MGM --verbose=0 -e'create nodegroup 5,6' alter table t1 algorithm=inplace, reorganize partition; alter table t2 algorithm=inplace, reorganize partition; --source ndb_read_local.inc drop table test.t1; drop table test.t2; --exec $NDB_MGM --verbose=0 -e'drop nodegroup 2' --exec $NDB_MGM --verbose=0 -e'drop nodegroup 1' --echo Test read-locality of FULLY-REPLICATED with FOR_RA_BY_NODE create table test.t1 (a int primary key, b int, c int, d int, unique(b) using hash, key(c), key(a,c)) comment="NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE" engine=ndb; create table test.t2 (a int primary key, b int, c int, d text, unique(b) using hash, key(c)) comment="NDB_TABLE=FULLY_REPLICATED=1,PARTITION_BALANCE=FOR_RA_BY_NODE" engine=ndb; --source ndb_read_local.inc --exec $NDB_MGM --verbose=0 -e'create nodegroup 3,4' alter table t1 algorithm=inplace, reorganize partition; alter table t2 algorithm=inplace, reorganize partition; --source ndb_read_local.inc --exec $NDB_MGM --verbose=0 -e'create nodegroup 5,6' alter table t1 algorithm=inplace, reorganize partition; alter table t2 algorithm=inplace, reorganize partition; --source ndb_read_local.inc drop table test.t1; drop table test.t2;