Skip to content

Commit

Permalink
test: fix the flaky test TestDeleteIgnoreWithFK (#57095)
Browse files Browse the repository at this point in the history
close #57094
  • Loading branch information
YangKeao authored Nov 4, 2024
1 parent f2621fa commit 572cf9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/executor/delete_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ func TestDeleteIgnoreWithFK(t *testing.T) {
tk.MustExec("insert into child2 values (1)")
require.NotNil(t, tk.ExecToErr("delete from parent, parent2 using parent inner join parent2 where parent.a = parent2.a"))
tk.MustExec("delete ignore from parent, parent2 using parent inner join parent2 where parent.a = parent2.a")
tk.MustQuery("show warnings").Check(testkit.Rows(
"Warning 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fk_1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`))",
"Warning 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child2`, CONSTRAINT `fk_1` FOREIGN KEY (`a`) REFERENCES `parent2` (`a`))"))
tk.MustQuery("show warnings").Sort().Check(testkit.Rows(
"Warning 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child2`, CONSTRAINT `fk_1` FOREIGN KEY (`a`) REFERENCES `parent2` (`a`))",
"Warning 1451 Cannot delete or update a parent row: a foreign key constraint fails (`test`.`child`, CONSTRAINT `fk_1` FOREIGN KEY (`a`) REFERENCES `parent` (`a`))"))
tk.MustQuery("select * from parent").Check(testkit.Rows("1"))
tk.MustQuery("select * from parent2").Check(testkit.Rows("1"))

Expand Down

0 comments on commit 572cf9e

Please sign in to comment.