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

Commitb239670

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 parentb8accd6 commitb239670

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.76.4.3 2010/07/05 09:27:49 heikki Exp $
15+
* $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.76.4.4 2010/07/13 09:03:11 heikki Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -298,6 +298,9 @@ PortalCreateHoldStore(Portal portal)
298298
/*
299299
* PinPortal
300300
*Protect a portal from dropping.
301+
*
302+
* A pinned portal is still unpinned and dropped at transaction or
303+
* subtransaction abort.
301304
*/
302305
void
303306
PinPortal(Portalportal)
@@ -764,6 +767,14 @@ AtSubCleanup_Portals(SubTransactionId mySubid)
764767
if (portal->createSubid!=mySubid)
765768
continue;
766769

770+
/*
771+
* If a portal is still pinned, forcibly unpin it. PortalDrop will not
772+
* let us drop the portal otherwise. Whoever pinned the portal was
773+
* interrupted by the abort too and won't try to use it anymore.
774+
*/
775+
if (portal->portalPinned)
776+
portal->portalPinned= false;
777+
767778
/* Zap it. */
768779
PortalDrop(portal, false);
769780
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp