config root man

Current Path : /home/usr.opt/mysql57/mysql-test/suite/ndb/r/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //home/usr.opt/mysql57/mysql-test/suite/ndb/r/ndb_fk_create_drop.result

create table parent (
a int primary key,
b int not null,
c int not null,
unique(b) using hash,
index(c)) engine = ndb;
create table child (
a int primary key,
b int not null,
c int not null,
unique(b) using hash,
index(c)) engine = ndb;
alter table child add constraint fk1 foreign key (a) references parent(a);
alter table child add constraint fk2 foreign key (b) references parent(a);
alter table child add constraint fk3 foreign key (c) references parent(a);
show create table child;
Table	Create Table
child	CREATE TABLE `child` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY (`a`),
  UNIQUE KEY `b` (`b`) USING HASH,
  KEY `c` (`c`),
  CONSTRAINT `fk1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk2` FOREIGN KEY (`b`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk3` FOREIGN KEY (`c`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
alter table child add constraint fk4 foreign key (a) references parent(b);
alter table child add constraint fk5 foreign key (b) references parent(b);
alter table child add constraint fk6 foreign key (c) references parent(b);
show create table child;
Table	Create Table
child	CREATE TABLE `child` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY (`a`),
  UNIQUE KEY `b` (`b`) USING HASH,
  KEY `c` (`c`),
  CONSTRAINT `fk1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk2` FOREIGN KEY (`b`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk3` FOREIGN KEY (`c`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk4` FOREIGN KEY (`a`) REFERENCES `parent` (`b`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk5` FOREIGN KEY (`b`) REFERENCES `parent` (`b`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk6` FOREIGN KEY (`c`) REFERENCES `parent` (`b`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
alter table child algorithm=copy, add constraint fk7 foreign key (a) references parent(c);
alter table child algorithm=copy, add constraint fk8 foreign key (a) references parent(c);
alter table child algorithm=copy, add constraint fk9 foreign key (a) references parent(c);
alter table child algorithm=inplace, add constraint fk7 foreign key (a) references parent(c);
ERROR HY000: Cannot add foreign key constraint
show warnings;
Level	Code	Message
Warning	1296	Got error 21026 'Create foreign key failed in NDB - parent index is not unique index' from NDB
Error	1215	Cannot add foreign key constraint
alter table child algorithm=inplace, add constraint fk8 foreign key (a) references parent(c);
ERROR HY000: Cannot add foreign key constraint
show warnings;
Level	Code	Message
Warning	1296	Got error 21026 'Create foreign key failed in NDB - parent index is not unique index' from NDB
Error	1215	Cannot add foreign key constraint
alter table child algorithm=inplace, add constraint fk9 foreign key (a) references parent(c);
ERROR HY000: Cannot add foreign key constraint
show warnings;
Level	Code	Message
Warning	1296	Got error 21026 'Create foreign key failed in NDB - parent index is not unique index' from NDB
Error	1215	Cannot add foreign key constraint
drop table child, parent;
create table parent (
a int primary key,
b int not null,
c int not null,
unique(b) using hash,
index(c)) engine = ndb;
create table child (
a int not null,
b int not null,
c int not null,
primary key (a),
unique key (b) using hash,
key (c),
constraint fk1 foreign key(a) references parent (a),
constraint fk2 foreign key(b) references parent (a),
constraint fk3 foreign key(c) references parent (a),
constraint fk4 foreign key(a) references parent (b),
constraint fk5 foreign key(b) references parent (b),
constraint fk6 foreign key(c) references parent (b)
) engine=ndbcluster;
show create table child;
Table	Create Table
child	CREATE TABLE `child` (
  `a` int(11) NOT NULL,
  `b` int(11) NOT NULL,
  `c` int(11) NOT NULL,
  PRIMARY KEY (`a`),
  UNIQUE KEY `b` (`b`) USING HASH,
  KEY `c` (`c`),
  CONSTRAINT `fk1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk2` FOREIGN KEY (`b`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk3` FOREIGN KEY (`c`) REFERENCES `parent` (`a`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk4` FOREIGN KEY (`a`) REFERENCES `parent` (`b`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk5` FOREIGN KEY (`b`) REFERENCES `parent` (`b`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk6` FOREIGN KEY (`c`) REFERENCES `parent` (`b`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
drop table child, parent;

Man Man