Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2751a24

Browse files
committed
Oops, in the previous fix to prevent a cursor that's being used in a FOR
loop from being dropped, I missed subtransaction cleanup. Pinned portalsmust be dropped at subtransaction cleanup just as they are at maintransaction cleanup.Per bug #5556 by Robert Walker. Backpatch to 8.0, 7.4 didn't havesubtransactions.
1 parentf0fd939 commit2751a24

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

‎src/backend/utils/mmgr/portalmem.c

Lines changed: 12 additions & 1 deletion
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.120 2010/07/06 19:18:59 momjian Exp $
15+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.121 2010/07/13 09:02:30 heikki Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -379,6 +379,9 @@ PortalCreateHoldStore(Portal portal)
379379
/*
380380
* PinPortal
381381
*Protect a portal from dropping.
382+
*
383+
* A pinned portal is still unpinned and dropped at transaction or
384+
* subtransaction abort.
382385
*/
383386
void
384387
PinPortal(Portalportal)
@@ -902,6 +905,14 @@ AtSubCleanup_Portals(SubTransactionId mySubid)
902905
if (portal->createSubid!=mySubid)
903906
continue;
904907

908+
/*
909+
* If a portal is still pinned, forcibly unpin it. PortalDrop will not
910+
* let us drop the portal otherwise. Whoever pinned the portal was
911+
* interrupted by the abort too and won't try to use it anymore.
912+
*/
913+
if (portal->portalPinned)
914+
portal->portalPinned= false;
915+
905916
/* Zap it. */
906917
PortalDrop(portal, false);
907918
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp