diff options
author | Bruce Momjian | 2005-05-11 18:05:37 +0000 |
---|---|---|
committer | Bruce Momjian | 2005-05-11 18:05:37 +0000 |
commit | c5c1cc3bf864b9783231b5b214f22d7b662b360f (patch) | |
tree | 658db05b928a5636de97a8b802dabfe47ed11a56 | |
parent | be1cc6955c80b790dc1054239ce0d92bf1ca8108 (diff) |
This patch will ensure that the hash table iteration performed by
AtCommit_Portals is restarted when a portal is deleted. This is
necessary since the deletion of a portal may cause the deletion of
another which on rare occations may cause the iterator to return a
deleted portal an thus a renewed attempt delete.
Thomas Hallgren
-rw-r--r-- | src/backend/utils/mmgr/portalmem.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index fd8a737adae..362d3df967f 100644 --- a/src/backend/utils/mmgr/portalmem.c +++ b/src/backend/utils/mmgr/portalmem.c @@ -12,7 +12,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.78 2005/04/11 19:51:15 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.79 2005/05/11 18:05:37 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -475,12 +475,6 @@ CommitHoldablePortals(void) * * Remove all non-holdable portals created in this transaction. * Portals remaining from prior transactions should be left untouched. - * - * XXX This assumes that portals can be deleted in a random order, ie, - * no portal has a reference to any other (at least not one that will be - * exercised during deletion). I think this is okay at the moment, but - * we've had bugs of that ilk in the past. Keep a close eye on cursor - * references... */ void AtCommit_Portals(void) @@ -516,6 +510,9 @@ AtCommit_Portals(void) /* Zap all non-holdable portals */ PortalDrop(portal, true); + + /* Restart the iteration */ + hash_seq_init(&status, PortalHashTable); } } |