Commit 946fdc00 authored by Tom Lane's avatar Tom Lane

Fix not-quite-right Assertion. Did not work at all in extended-query

mode (per complaint from Kris Jurka) and it was only by chance that it
didn't fail in simple-query mode.  A COMMIT or ROLLBACK has to be
executed by a portal, therefore it's wrong to suppose that there aren't
any live portals at CleanupTransaction time.
parent 9aa30e71
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.67 2004/07/17 03:29:46 tgl Exp $ * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.68 2004/08/02 21:42:18 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -556,10 +556,6 @@ AtCleanup_Portals(void) ...@@ -556,10 +556,6 @@ AtCleanup_Portals(void)
{ {
Portal portal = hentry->portal; Portal portal = hentry->portal;
/* AtAbort_Portals should have fixed these: */
Assert(portal->status != PORTAL_ACTIVE);
Assert(portal->resowner == NULL);
/* /*
* Do nothing else to cursors held over from a previous * Do nothing else to cursors held over from a previous
* transaction. (This test must include checking CURSOR_OPT_HOLD, * transaction. (This test must include checking CURSOR_OPT_HOLD,
...@@ -568,7 +564,11 @@ AtCleanup_Portals(void) ...@@ -568,7 +564,11 @@ AtCleanup_Portals(void)
*/ */
if (portal->createXact != xact && if (portal->createXact != xact &&
(portal->cursorOptions & CURSOR_OPT_HOLD)) (portal->cursorOptions & CURSOR_OPT_HOLD))
{
Assert(portal->status != PORTAL_ACTIVE);
Assert(portal->resowner == NULL);
continue; continue;
}
/* Else zap it. */ /* Else zap it. */
PortalDrop(portal, false); PortalDrop(portal, false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment