Skip to content

Commit

Permalink
*: fix TestAddForeignKeyWithAutoCreateIndex for InfoSchema v2 (#52228)
Browse files Browse the repository at this point in the history
ref #50959
  • Loading branch information
ywqzzy committed Mar 29, 2024
1 parent 0e9e712 commit 693ed4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/realtikvtest/addindextest/add_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ func TestAddForeignKeyWithAutoCreateIndex(t *testing.T) {
tk.MustExec("update employee set pid=0 where id=1")
tk.MustGetErrMsg("alter table employee add foreign key fk_1(pid) references employee(id)",
"[ddl:1452]Cannot add or update a child row: a foreign key constraint fails (`fk_index`.`employee`, CONSTRAINT `fk_1` FOREIGN KEY (`pid`) REFERENCES `employee` (`id`))")
tk.MustExec("update employee set pid=null where id=1")
tk.MustExec("insert into employee (pid) select pid from employee")
tk.MustExec("update employee set pid=id-1 where id>1 and pid is null")
tk.MustExec("update employee set pid=id")

tk.MustExec("alter table employee add foreign key fk_1(pid) references employee(id)")
}

Expand Down

0 comments on commit 693ed4e

Please sign in to comment.