Skip to content

Commit 8e5c9cd

Browse files
author
Shlomi Noach
committed
adding fk tests
1 parent 5d312a2 commit 8e5c9cd

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

localtests/discard-fk/create.sql

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
drop table if exists gh_ost_test;
2+
drop table if exists gh_ost_test_fk_parent;
3+
create table gh_ost_test_fk_parent (
4+
id int auto_increment,
5+
ts timestamp,
6+
primary key(id)
7+
);
8+
create table gh_ost_test (
9+
id int auto_increment,
10+
i int not null,
11+
parent_id int not null,
12+
primary key(id),
13+
constraint test_fk foreign key (parent_id) references gh_ost_test_fk_parent (id) on delete no action
14+
) auto_increment=1;
15+
16+
insert into gh_ost_test_fk_parent (id) values (1),(2),(3);
17+
18+
drop event if exists gh_ost_test;
19+
delimiter ;;
20+
create event gh_ost_test
21+
on schedule every 1 second
22+
starts current_timestamp
23+
ends current_timestamp + interval 60 second
24+
on completion not preserve
25+
enable
26+
do
27+
begin
28+
insert into gh_ost_test values (null, 11, 1);
29+
insert into gh_ost_test values (null, 13, 2);
30+
insert into gh_ost_test values (null, 17, 3);
31+
end ;;

localtests/discard-fk/extra_args

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--discard-foreign-keys

0 commit comments

Comments
 (0)