1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

Run a portal's cleanup hook immediately when pushing it to DONE state.

This works around the problem noted by Yamamoto Takashi in bug #5906,
that there were code paths whereby we could reach AtCleanup_Portals
with a portal's cleanup hook still unexecuted.  The changes I made
a few days ago were intended to prevent that from happening, and
I think that on balance it's still a good thing to avoid, so I don't
want to remove the Assert in AtCleanup_Portals.  Hence do this instead.
This commit is contained in:
Tom Lane
2011-03-03 13:03:34 -05:00
parent 32fce70564
commit 6252c4f9e2
3 changed files with 28 additions and 1 deletions

View File

@ -814,7 +814,7 @@ PortalRun(Portal portal, long count, bool isTopLevel,
dest, altdest, completionTag);
/* Prevent portal's commands from being re-executed */
portal->status = PORTAL_DONE;
MarkPortalDone(portal);
/* Always complete at end of RunMulti */
result = true;