⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
suite
/
ndb
/
r
/
View File Name :
ndb_fk_mysqldump.result
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; Table Create Table product CREATE TABLE `product` ( `category` int(11) NOT NULL, `id` int(11) NOT NULL, `price` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`category`,`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 show create table customer; Table Create Table customer CREATE TABLE `customer` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 show create table product_order; Table Create Table product_order CREATE TABLE `product_order` ( `no` int(11) NOT NULL AUTO_INCREMENT, `product_category` int(11) NOT NULL, `product_id` int(11) NOT NULL, `customer_id` int(11) NOT NULL, PRIMARY KEY (`no`), KEY `product_category` (`product_category`,`product_id`), KEY `customer_id` (`customer_id`), CONSTRAINT `fk1` FOREIGN KEY (`product_category`,`product_id`) REFERENCES `product` (`category`,`id`) ON DELETE CASCADE ON UPDATE RESTRICT, CONSTRAINT `fk2` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 insert into product values (1,1,5); insert into customer value (1); insert into product_order value (1,1,1,1); drop table product_order, customer, product; show create table product; Table Create Table product CREATE TABLE `product` ( `category` int(11) NOT NULL, `id` int(11) NOT NULL, `price` decimal(10,0) DEFAULT NULL, PRIMARY KEY (`category`,`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 show create table customer; Table Create Table customer CREATE TABLE `customer` ( `id` int(11) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 show create table product_order; Table Create Table product_order CREATE TABLE `product_order` ( `no` int(11) NOT NULL AUTO_INCREMENT, `product_category` int(11) NOT NULL, `product_id` int(11) NOT NULL, `customer_id` int(11) NOT NULL, PRIMARY KEY (`no`), KEY `product_category` (`product_category`,`product_id`), KEY `customer_id` (`customer_id`), CONSTRAINT `fk2` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `fk1` FOREIGN KEY (`product_category`,`product_id`) REFERENCES `product` (`category`,`id`) ON DELETE CASCADE ON UPDATE RESTRICT ) ENGINE=ndbcluster AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 drop table product_order, customer, product;