12
12
* Portions Copyright (c) 1994, Regents of the University of California
13
13
*
14
14
* IDENTIFICATION
15
- * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.76 2004/12/31 22:02:48 pgsql Exp $
15
+ * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.77 2005/01/26 23:20:21 tgl Exp $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -601,9 +601,11 @@ AtSubCommit_Portals(SubTransactionId mySubid,
601
601
/*
602
602
* Subtransaction abort handling for portals.
603
603
*
604
- * Deactivate failed portals created during the failed subtransaction.
604
+ * Deactivate portals created during the failed subtransaction.
605
605
* Note that per AtSubCommit_Portals, this will catch portals created
606
606
* in descendants of the subtransaction too.
607
+ *
608
+ * We don't destroy any portals here; that's done in AtSubCleanup_Portals.
607
609
*/
608
610
void
609
611
AtSubAbort_Portals (SubTransactionId mySubid ,
@@ -628,21 +630,31 @@ AtSubAbort_Portals(SubTransactionId mySubid,
628
630
* will go FAILED if the underlying cursor fails. (Note we do NOT
629
631
* want to do this to upper-level portals, since they may be able
630
632
* to continue.)
633
+ *
634
+ * This is only needed to dodge the sanity check in PortalDrop.
631
635
*/
632
636
if (portal -> status == PORTAL_ACTIVE )
633
637
portal -> status = PORTAL_FAILED ;
634
638
635
639
/*
636
640
* If the portal is READY then allow it to survive into the parent
637
641
* transaction; otherwise shut it down.
642
+ *
643
+ * Currently, we can't actually support that because the portal's
644
+ * query might refer to objects created or changed in the failed
645
+ * subtransaction, leading to crashes if execution is resumed.
646
+ * So, even READY portals are deleted. It would be nice to detect
647
+ * whether the query actually depends on any such object, instead.
638
648
*/
649
+ #ifdef NOT_USED
639
650
if (portal -> status == PORTAL_READY )
640
651
{
641
652
portal -> createSubid = parentSubid ;
642
653
if (portal -> resowner )
643
654
ResourceOwnerNewParent (portal -> resowner , parentXactOwner );
644
655
}
645
656
else
657
+ #endif
646
658
{
647
659
/* let portalcmds.c clean up the state it knows about */
648
660
if (PointerIsValid (portal -> cleanup ))
0 commit comments