-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8228 from planetscale/online-ddl-vrpel-suite-fail-fk
Online DDL/VReplication: fail on existence of FOREIGN KEY
- Loading branch information
Showing
10 changed files
with
93 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
go/test/endtoend/onlineddl/vrepl_suite/testdata/discard-fk/extra_args
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
go/test/endtoend/onlineddl/vrepl_suite/testdata/fail-fk-child/expect_failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foreign key constraints are not supported in online DDL |
34 changes: 34 additions & 0 deletions
34
go/test/endtoend/onlineddl/vrepl_suite/testdata/fail-fk-parent/create.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
set session foreign_key_checks=0; | ||
drop table if exists onlineddl_test_child; | ||
drop table if exists onlineddl_test; | ||
drop table if exists onlineddl_test_parent; | ||
set session foreign_key_checks=1; | ||
create table onlineddl_test ( | ||
id int auto_increment, | ||
ts timestamp, | ||
primary key(id) | ||
); | ||
create table onlineddl_test_child ( | ||
id int auto_increment, | ||
i int not null, | ||
parent_id int not null, | ||
primary key(id), | ||
constraint test_fk foreign key (parent_id) references onlineddl_test (id) on delete no action | ||
) auto_increment=1; | ||
|
||
insert into onlineddl_test (id) values (1),(2),(3); | ||
|
||
drop event if exists onlineddl_test; | ||
delimiter ;; | ||
create event onlineddl_test | ||
on schedule every 1 second | ||
starts current_timestamp | ||
ends current_timestamp + interval 60 second | ||
on completion not preserve | ||
enable | ||
do | ||
begin | ||
insert into onlineddl_test_child values (null, 11, 1); | ||
insert into onlineddl_test_child values (null, 13, 2); | ||
insert into onlineddl_test_child values (null, 17, 3); | ||
end ;; |
1 change: 1 addition & 0 deletions
1
go/test/endtoend/onlineddl/vrepl_suite/testdata/fail-fk-parent/expect_failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foreign key constraints are not supported in online DDL |
32 changes: 0 additions & 32 deletions
32
go/test/endtoend/onlineddl/vrepl_suite/untestdata/fail-fk/create.sql
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
go/test/endtoend/onlineddl/vrepl_suite/untestdata/fail-fk/expect_failure
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters