adding fk tests
This commit is contained in:
parent
5d312a2bfb
commit
8e5c9cd5e1
31
localtests/discard-fk/create.sql
Normal file
31
localtests/discard-fk/create.sql
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
drop table if exists gh_ost_test;
|
||||||
|
drop table if exists gh_ost_test_fk_parent;
|
||||||
|
create table gh_ost_test_fk_parent (
|
||||||
|
id int auto_increment,
|
||||||
|
ts timestamp,
|
||||||
|
primary key(id)
|
||||||
|
);
|
||||||
|
create table gh_ost_test (
|
||||||
|
id int auto_increment,
|
||||||
|
i int not null,
|
||||||
|
parent_id int not null,
|
||||||
|
primary key(id),
|
||||||
|
constraint test_fk foreign key (parent_id) references gh_ost_test_fk_parent (id) on delete no action
|
||||||
|
) auto_increment=1;
|
||||||
|
|
||||||
|
insert into gh_ost_test_fk_parent (id) values (1),(2),(3);
|
||||||
|
|
||||||
|
drop event if exists gh_ost_test;
|
||||||
|
delimiter ;;
|
||||||
|
create event gh_ost_test
|
||||||
|
on schedule every 1 second
|
||||||
|
starts current_timestamp
|
||||||
|
ends current_timestamp + interval 60 second
|
||||||
|
on completion not preserve
|
||||||
|
enable
|
||||||
|
do
|
||||||
|
begin
|
||||||
|
insert into gh_ost_test values (null, 11, 1);
|
||||||
|
insert into gh_ost_test values (null, 13, 2);
|
||||||
|
insert into gh_ost_test values (null, 17, 3);
|
||||||
|
end ;;
|
1
localtests/discard-fk/extra_args
Normal file
1
localtests/discard-fk/extra_args
Normal file
@ -0,0 +1 @@
|
|||||||
|
--discard-foreign-keys
|
Loading…
Reference in New Issue
Block a user