Skip to content

Commit 946fdc0

Browse files
committed
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.
1 parent 9aa30e7 commit 946fdc0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/backend/utils/mmgr/portalmem.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.67 2004/07/17 03:29:46 tgl Exp $
15+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.68 2004/08/02 21:42:18 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -556,10 +556,6 @@ AtCleanup_Portals(void)
556556
{
557557
Portal portal = hentry->portal;
558558

559-
/* AtAbort_Portals should have fixed these: */
560-
Assert(portal->status != PORTAL_ACTIVE);
561-
Assert(portal->resowner == NULL);
562-
563559
/*
564560
* Do nothing else to cursors held over from a previous
565561
* transaction. (This test must include checking CURSOR_OPT_HOLD,
@@ -568,7 +564,11 @@ AtCleanup_Portals(void)
568564
*/
569565
if (portal->createXact != xact &&
570566
(portal->cursorOptions & CURSOR_OPT_HOLD))
567+
{
568+
Assert(portal->status != PORTAL_ACTIVE);
569+
Assert(portal->resowner == NULL);
571570
continue;
571+
}
572572

573573
/* Else zap it. */
574574
PortalDrop(portal, false);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy