diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-08-08 20:12:52 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-08-08 20:12:52 +0000 |
| commit | 4488b69b4cd388cb557ced8165df8eeb984db73a (patch) | |
| tree | b9a3d566c24d8788ba6c61a9ca7d029198e15963 /src/backend/access/nbtree/nbtscan.c | |
| parent | fb491a5854f6883f38bffac0591c754b475695af (diff) | |
| download | postgresql-4488b69b4cd388cb557ced8165df8eeb984db73a.tar.gz | |
Fix nbtree's failure to clear BTScans list during xact abort.
Also, move responsibility for calling vc_abort into main xact.c list of
things-to-call-at-abort. What in the world was it doing down inside of
TransactionIdAbort()?
Diffstat (limited to 'src/backend/access/nbtree/nbtscan.c')
| -rw-r--r-- | src/backend/access/nbtree/nbtscan.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/backend/access/nbtree/nbtscan.c b/src/backend/access/nbtree/nbtscan.c index a655a442ee..f5c1f7b99f 100644 --- a/src/backend/access/nbtree/nbtscan.c +++ b/src/backend/access/nbtree/nbtscan.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.27 1999/07/15 23:03:00 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/access/nbtree/Attic/nbtscan.c,v 1.28 1999/08/08 20:12:51 tgl Exp $ * * * NOTES @@ -44,6 +44,28 @@ static BTScanList BTScans = (BTScanList) NULL; static void _bt_scandel(IndexScanDesc scan, BlockNumber blkno, OffsetNumber offno); /* + * AtEOXact_nbtree() --- clean up nbtree subsystem at xact abort or commit. + * + * This is here because it needs to touch this module's static var BTScans. + */ +void +AtEOXact_nbtree(void) +{ + /* Note: these actions should only be necessary during xact abort; + * but they can't hurt during a commit. + */ + + /* Reset the active-scans list to empty. + * We do not need to free the list elements, because they're all + * palloc()'d, so they'll go away at end of transaction anyway. + */ + BTScans = NULL; + + /* If we were building a btree, we ain't anymore. */ + BuildingBtree = false; +} + +/* * _bt_regscan() -- register a new scan. */ void |
