polardbxengine/mysql-test/suite/ndb/t/ndb_addnode.test

216 lines
6.3 KiB
Plaintext

-- source include/have_ndb.inc
--source include/not_windows.inc
--echo "Create nodegroup with out-of-range node ID"
--error 255
--exec $NDB_MGM --verbose=0 -e "create nodegroup 147,148"
--error 255
--exec $NDB_MGM --verbose=0 -e "create nodegroup 4,147"
--echo "Create nodegroup with in-range but inactive node ID"
--error 255
--exec $NDB_MGM --verbose=0 -e "create nodegroup 48,3"
--error 255
--exec $NDB_MGM --verbose=0 -e "create nodegroup 4,48"
--source ndb_mgm_show_table.inc
let $non_windows = 0;
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
{
let $non_windows = 1;
}
CREATE LOGFILE GROUP lg_1
ADD UNDOFILE 'undo_1.dat'
INITIAL_SIZE 4M
UNDO_BUFFER_SIZE 2M
ENGINE NDB;
CREATE TABLESPACE ts_1
ADD DATAFILE 'data_1.dat'
USE LOGFILE GROUP lg_1
INITIAL_SIZE 16M
ENGINE NDB;
# Using a pk bigger than 80 bytes, see bug#25152165.
create table t1(id int, data char(8), id2 binary(80), primary key (id, id2)) engine=ndb;
create table t2(id int NOT NULL PRIMARY KEY, data char(8))
TABLESPACE ts_1 STORAGE DISK engine=ndb;
# BUG#13714648
create table t5(id int NOT NULL PRIMARY KEY, data char(8)) max_rows=50000000 engine=ndb;
create table t6(id int not null primary key, dat blob, txt text) engine=ndb;
# Get blob tables table test.t6
let ndb_database= test;
let ndb_table= t6;
--source suite/ndb/include/ndb_get_blob_tables.inc
load data local infile 'suite/ndb/data/table_data10000.dat' into table t1 fields terminated by ' ' lines terminated by '\n' (id, @data) set data = @data, id2 = repeat(@data,10);
load data local infile 'suite/ndb/data/table_data10000.dat' into table t2 fields terminated by ' ' lines terminated by '\n';
load data local infile 'suite/ndb/data/table_data10000.dat' into table t5 fields terminated by ' ' lines terminated by '\n';
load data local infile 'suite/ndb/data/table_data10000.dat' into table t6 fields terminated by ' ' lines terminated by '\n' (id, @data) set dat = repeat(@data, 100), txt = repeat(@data,100);
## Check details of t1 partitioning
--echo "Table t1 Partition info"
let ndb_table= t1;
--source ndb_desc_show_partition_info.inc
## Check details of t2 partitioning
--echo "Table t2 Partition info"
let ndb_table= t2;
--source ndb_desc_show_partition_info.inc
## Check details of t5 partitioning
--echo "Table t5 Partition info"
let ndb_table= t5;
--source ndb_desc_show_partition_info.inc
## Check details of t6 partitioning
--echo "Table t6 Partition info"
let ndb_table= t6;
--source ndb_desc_show_partition_info.inc
## Check details of t6 blob table partitioning
--echo "Table t6 blob dat Partition info"
let ndb_table= $bt_test_t6_dat;
if($non_windows)
{
let ndb_table= '$bt_test_t6_dat';
}
--source ndb_desc_show_partition_info.inc
--echo "Table t6 blob txt Partition info"
let ndb_table= $bt_test_t6_txt;
if($non_windows)
{
let ndb_table= '$bt_test_t6_txt';
}
--source ndb_desc_show_partition_info.inc
## Create nodegroup for "new" nodes
--exec $NDB_MGM --verbose=0 -e "create nodegroup 3,4"
--sleep 5
# Cluster running after adding two ndbd nodes
--source ndb_mgm_show_table.inc
## Drop
--exec $NDB_MGM --verbose=0 -e "drop nodegroup 1"
## and create
--exec $NDB_MGM --verbose=0 -e "create nodegroup 3,4"
set @@new = 1;
#create table t7(id int primary key, uk int, unique key (uk)) engine=ndb
create table t7(id int primary key, uk int) engine=ndb
partition by list(id) (
partition p0 values in (0),
partition p1 values in (1),
partition p2 values in (2),
partition p3 values in (3),
partition p4 values in (4)
);
drop table t7;
create table t3(id int NOT NULL PRIMARY KEY, data char(8)) engine=ndb;
create table t4(id int NOT NULL PRIMARY KEY, data char(8))
TABLESPACE ts_1 STORAGE DISK engine=ndb;
insert into t3(id, data) VALUES
(1,'new'), (2,'new'),(3,'new'),(4,'new'),(5,'new'),
(6,'new'),(7,'new'),(8,'new'),(9,'new'),(10,'new');
insert into t4(id, data) VALUES
(1,'new'), (2,'new'),(3,'new'),(4,'new'),(5,'new'),
(6,'new'),(7,'new'),(8,'new'),(9,'new'),(10,'new');
alter table t1 algorithm=inplace, add column c int unsigned default null;
alter table t1 reorganize partition;
alter table t2 reorganize partition;
alter table t5 algorithm=inplace, max_rows=300000000;
if (!$DISABLE_BLOB_REORG)
{
alter table t6 reorganize partition;
}
## Check details of t1 partitioning
--echo "Table t1 Partition info"
let ndb_table= t1;
--source ndb_desc_show_partition_info.inc
## Check details of t2 partitioning
--echo "Table t2 Partition info"
let ndb_table= t2;
--source ndb_desc_show_partition_info.inc
## Check details of t3 partitioning
--echo "Table t3 Partition info"
let ndb_table= t3;
--source ndb_desc_show_partition_info.inc
## Check details of t4 partitioning
--echo "Table t4 Partition info"
let ndb_table= t4;
--source ndb_desc_show_partition_info.inc
## Check details of t5 partitioning
--echo "Table t5 Partition info"
let ndb_table= t5;
--source ndb_desc_show_partition_info.inc
## Simple blob usage of t6
select count(0) as row_count from t6;
## Check details of t6 partitioning
--echo "Table t6 Partition info"
let ndb_table= t6;
--source ndb_desc_show_partition_info.inc
## Check details of t6 blob table partitioning
--echo "Table t6 blob dat Partition info"
let ndb_table= $bt_test_t6_dat;
if($non_windows)
{
let ndb_table= '$bt_test_t6_dat';
}
--source ndb_desc_show_partition_info.inc
--echo "Table t6 blob txt Partition info"
let ndb_table= $bt_test_t6_txt;
if($non_windows)
{
let ndb_table= '$bt_test_t6_txt';
}
--source ndb_desc_show_partition_info.inc
# Check that main table and blob tables have same hashmap.
let ndb_database= test;
let ndb_table= t6;
let ndb_die_on_error= 1;
--replace_regex /.* BT=.*//
--source suite/ndb/include/ndb_check_blob_tables.inc
## Drop nodegroup with "new" nodes is not allowed with data one those nodes
# NOTE: --error=0 is due to return codes doesnt work on windoze
--error 0,255
--exec $NDB_MGM --verbose=0 -e "drop nodegroup 1"
## Nodegroup with "new" nodes still exist after dropping it as shown:
--source ndb_mgm_show_table.inc
drop table t1,t2,t3,t4,t5,t6;
## Drop nodegroup with "new" nodes
--exec $NDB_MGM --verbose=0 -e "drop nodegroup 1"
## Nodegroup with "new" nodes still exists after dropping it as shown:
--source ndb_mgm_show_table.inc
# Cleanup
ALTER TABLESPACE ts_1 DROP DATAFILE 'data_1.dat';
DROP TABLESPACE ts_1;
DROP LOGFILE GROUP lg_1 ENGINE NDB;