From 7e332236130fc023b81125a059e3b5306b8d82bf Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Mon, 18 Mar 2024 11:24:33 +0530 Subject: [PATCH] test: added e2e fk test for multi target delete Signed-off-by: Harshit Gangal --- go/test/endtoend/vtgate/foreignkey/fk_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/go/test/endtoend/vtgate/foreignkey/fk_test.go b/go/test/endtoend/vtgate/foreignkey/fk_test.go index a83059454ad..a1619970b5c 100644 --- a/go/test/endtoend/vtgate/foreignkey/fk_test.go +++ b/go/test/endtoend/vtgate/foreignkey/fk_test.go @@ -704,6 +704,22 @@ func TestFkScenarios(t *testing.T) { "select * from fk_multicol_t17 order by id", "select * from fk_multicol_t19 order by id", }, + }, { + name: "Multi Target Delete success", + dataQueries: []string{ + "insert into fk_multicol_t15(id, cola, colb) values (1, 7, 1), (2, 9, 1), (3, 11, 1), (4, 13, 1)", + "insert into fk_multicol_t16(id, cola, colb) values (1, 7, 1), (2, 9, 1), (3, 11, 1), (4, 13, 1)", + "insert into fk_multicol_t17(id, cola, colb) values (1, 7, 1), (2, 9, 1), (3, 11, 1)", + "insert into fk_multicol_t18(id, cola, colb) values (1, 7, 1), (3, 11, 1)", + "insert into fk_multicol_t19(id, cola, colb) values (1, 7, 1), (2, 9, 1)", + }, + dmlQuery: "delete fk_multicol_t15, fk_multicol_t17 from fk_multicol_t15 join fk_multicol_t17 where fk_multicol_t15.id = fk_multicol_t17.id", + assertionQueries: []string{ + "select * from fk_multicol_t15 order by id", + "select * from fk_multicol_t16 order by id", + "select * from fk_multicol_t17 order by id", + "select * from fk_multicol_t19 order by id", + }, }, { name: "Delete with limit success", dataQueries: []string{