mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
> > There is a bug in check_foreign_key of refint.c which is bundled with
> > the standard distribution. It occurs when a trigger calling this > > function recursively fires another trigger which calls the same > > function. The calling check_foreign_key loses its plan informantion and > > when it tries to use it the backend closes its channel. You can check it > > with the sql script I am attaching below. > > The solution to this is to do a find_plan again before executing it at > > line 483 of refint.c. > > Therefore two more lines should be added before line 483: Anand Surelia
This commit is contained in:
@ -480,6 +480,8 @@ check_foreign_key()
|
||||
|
||||
relname = args[0];
|
||||
|
||||
sprintf(ident, "%s$%u", trigger->tgname, rel->rd_id);
|
||||
plan = find_plan(ident, &FPlans, &nFPlans);
|
||||
ret = SPI_execp(plan->splan[r], kvals, NULL, tcount);
|
||||
/* we have no NULLs - so we pass ^^^^ here */
|
||||
|
||||
|
Reference in New Issue
Block a user