| 1 |
-- source include/have_ndb.inc |
| 2 |
-- source include/have_ndb_debug.inc |
| 3 |
|
| 4 |
-- disable_warnings |
| 5 |
drop table if exists t1,t2; |
| 6 |
-- enable_warnings |
| 7 |
|
| 8 |
create table t1 ( |
| 9 |
a int not null, |
| 10 |
b int not null, |
| 11 |
primary key using hash (a), |
| 12 |
unique key using hash (b) |
| 13 |
) engine ndb; |
| 14 |
|
| 15 |
create table t2 ( |
| 16 |
a int not null, |
| 17 |
b int not null, |
| 18 |
primary key using hash (a), |
| 19 |
key (b) |
| 20 |
) engine ndb comment="NDB_TABLE=FULLY_REPLICATED=1"; |
| 21 |
|
| 22 |
alter table t2 add constraint fk1 foreign key (b) references t1(a); |
| 23 |
|
| 24 |
insert into t1 values (1,1); |
| 25 |
insert into t2 values (1,1); |
| 26 |
|
| 27 |
--exec $NDB_MGM -e "ALL ERROR 5102" >> $NDB_TOOLS_OUTPUT |
| 28 |
--error 1297 |
| 29 |
delete from t2 where b = 1; |
| 30 |
--error 1297 |
| 31 |
insert into t2 values (2,1); |
| 32 |
--exec $NDB_MGM -e "ALL ERROR 0" >> $NDB_TOOLS_OUTPUT |
| 33 |
|
| 34 |
-- disable_warnings |
| 35 |
drop table t2; |
| 36 |
drop table t1; |
| 37 |
-- enable_warnings |
| 38 |
--remove_file $NDB_TOOLS_OUTPUT |