config root man

Current Path : /usr/opt/mysql57/mysql-test/suite/ndb/t/

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 : //usr/opt/mysql57/mysql-test/suite/ndb/t/ndb_fk_mysqldump.test

-- source include/have_ndb.inc

# test uses mysqldump, hence not in embedded
-- source include/not_embedded.inc

create table product (
  category int not null,
  id int not null,
  price decimal,
  primary key(category, id))
engine=ndb;

create table customer (
  id int not null,
  primary key (id))
engine=ndb;

create table product_order (
  no int not null auto_increment,
  product_category int not null,
  product_id int not null,
  customer_id int not null,
  primary key(no),
  index (product_category, product_id),
  constraint fk1
  foreign key (product_category, product_id) references product(category, id)
    on update restrict on delete cascade,
  index (customer_id),
  constraint fk2
  foreign key (customer_id) references customer(id))
engine=ndb;

show create table product;
show create table customer;
show create table product_order;

insert into product values (1,1,5);
insert into customer value (1);
insert into product_order value (1,1,1,1);

let $dump_file = $MYSQLTEST_VARDIR/tmp/ndb_fk_dump.sql;
--exec $MYSQL_DUMP --databases test > $dump_file

# bug#16286164: the fix exposes DROP order problem
if (1)
{
drop table product_order, customer, product;
}

--exec $MYSQL test < $dump_file

show create table product;
show create table customer;
show create table product_order;

drop table product_order, customer, product;

Man Man