Server IP : 172.67.216.182 / Your IP : 108.162.226.196 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/server/mysql/src/mysql-test/suite/ndb/t/ |
Upload File : |
-- source include/have_ndb.inc ### ### insert PK vs PK ### create table t1 ( a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, primary key (a), unique(c) using hash, index(e)) engine = ndb; alter table t1 add constraint fkname foreign key (a) references t1(a) on delete restrict on update restrict; insert into t1 values (1,1,1,1,1,1); alter table t1 drop foreign key fkname; delete from t1; ### ### insert PK vs UK ### alter table t1 add constraint fkname foreign key (c) references t1(a) on delete restrict on update restrict; insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,3,3,2,2); alter table t1 drop foreign key fkname; delete from t1; ### ### insert PK vs OI ### alter table t1 add constraint fkname foreign key (e) references t1(a) on delete restrict on update restrict; insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,2,2,3,3); alter table t1 drop foreign key fkname; delete from t1; ### ### insert UK vs PK ### alter table t1 add constraint fkname foreign key (a) references t1(c) on delete restrict on update restrict; # # BUG! (but manual tests 2013-03-19 indicates that innodb has the same bug) # # insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,3,3,2,2); alter table t1 drop foreign key fkname; delete from t1; ### ### insert UK vs UK ### alter table t1 add constraint fkname foreign key (c) references t1(c) on delete restrict on update restrict; # # BUG! (but manual tests 2013-03-19 indicates that innodb has the same bug) # # insert into t1 values (1,1,1,1,1,1); alter table t1 drop foreign key fkname; delete from t1; ### ### insert UK vs OI ### alter table t1 add constraint fkname foreign key (e) references t1(c) on delete restrict on update restrict; # # BUG! (but manual tests 2013-03-19 indicates that innodb has the same bug) # # insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,2,2,3,3); alter table t1 drop foreign key fkname; delete from t1; drop table t1; ### ### insert PK vs PK ### create table t1 ( a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, primary key (a,b), unique(c,d) using hash, index(e,f)) engine = ndb; alter table t1 add constraint fkname foreign key (a,b) references t1(a,b) on delete no action on update no action; insert into t1 values (1,1,1,1,1,1); alter table t1 drop foreign key fkname; delete from t1; ### ### insert PK vs UK ### alter table t1 add constraint fkname foreign key (c,d) references t1(a,b) on delete no action on update no action; insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,3,3,2,2); alter table t1 drop foreign key fkname; delete from t1; ### ### insert PK vs OI ### alter table t1 add constraint fkname foreign key (e,f) references t1(a,b) on delete no action on update no action; insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,2,2,3,3); alter table t1 drop foreign key fkname; delete from t1; ### ### insert UK vs PK ### alter table t1 add constraint fkname foreign key (a,b) references t1(c,d) on delete no action on update no action; insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,3,3,2,2); alter table t1 drop foreign key fkname; delete from t1; ### ### insert UK vs UK ### alter table t1 add constraint fkname foreign key (c,d) references t1(c,d) on delete no action on update no action; insert into t1 values (1,1,1,1,1,1); alter table t1 drop foreign key fkname; delete from t1; ### ### insert UK vs OI ### alter table t1 add constraint fkname foreign key (e,f) references t1(c,d) on delete no action on update no action; insert into t1 values (1,1,1,1,1,1); --error 1452 insert into t1 values (2,2,2,2,3,3); alter table t1 drop foreign key fkname; delete from t1; drop table t1;