| 1 |
create table t1(id1 int NOT NULL PRIMARY KEY, data char(8), id3 int not null, unique(id3)) engine=ndb |
| 2 |
comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"; |
| 3 |
create table t2(id2 int NOT NULL PRIMARY KEY, id1 int, data char(8), id3 int) engine=ndb |
| 4 |
comment="NDB_TABLE=PARTITION_BALANCE=FOR_RP_BY_LDM"; |
| 5 |
alter table t2 algorithm=inplace, add constraint id1 foreign key (id1) references t1(id1); |
| 6 |
alter table t2 algorithm=inplace, add constraint id3 foreign key (id3) references t1(id3); |
| 7 |
load data local infile 'suite/ndb/data/table_data10000.dat' into table t1 fields terminated by ' ' lines terminated by '\n' ignore 900 lines (@id, data) set id1 = @id, id3 = -@id; |
| 8 |
load data local infile 'suite/ndb/data/table_data10000.dat' into table t2 fields terminated by ' ' lines terminated by '\n' ignore 900 lines (@id, data) set id1 = @id, id2 = -@id, id3=-@id; |
| 9 |
SELECT partitions, fragments, hash_map from ndbinfo.dictionary_tables |
| 10 |
WHERE table_name in ("t1", "t2"); |
| 11 |
partitions fragments hash_map |
| 12 |
2 2 DEFAULT-HASHMAP-3840-2 |
| 13 |
2 2 DEFAULT-HASHMAP-3840-2 |
| 14 |
Nodegroup 1 created |
| 15 |
Drop Node Group 1 done |
| 16 |
Nodegroup 1 created |
| 17 |
alter table t2 algorithm=inplace, reorganize partition; |
| 18 |
alter table t1 algorithm=inplace, reorganize partition; |
| 19 |
SELECT partitions, fragments, hash_map from ndbinfo.dictionary_tables |
| 20 |
WHERE table_name in ("t1", "t2"); |
| 21 |
partitions fragments hash_map |
| 22 |
4 4 DEFAULT-HASHMAP-3840-4 |
| 23 |
4 4 DEFAULT-HASHMAP-3840-4 |
| 24 |
Check node restart after reorg with foreign keys |
| 25 |
--- Wait for node to stop |
| 26 |
--- Startup node again |
| 27 |
--- Wait for node to recover |
| 28 |
* 1006: Illegal reply from server |
| 29 |
* error: -2 |
| 30 |
drop table t2,t1; |
| 31 |
Drop Node Group 1 done |