mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Nested transactions. There is still much left to do, especially on the
performance front, but with feature freeze upon us I think it's time to drive a stake in the ground and say that this will be in 7.5. Alvaro Herrera, with some help from Tom Lane.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.51 2004/01/07 18:56:23 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.52 2004/07/01 00:49:27 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -41,6 +41,7 @@ static void adjustiptr(IndexScanDesc s, ItemPointer iptr,
|
||||
typedef struct GISTScanListData
|
||||
{
|
||||
IndexScanDesc gsl_scan;
|
||||
TransactionId gsl_creatingXid;
|
||||
struct GISTScanListData *gsl_next;
|
||||
} GISTScanListData;
|
||||
|
||||
@ -223,6 +224,7 @@ gistregscan(IndexScanDesc s)
|
||||
|
||||
l = (GISTScanList) palloc(sizeof(GISTScanListData));
|
||||
l->gsl_scan = s;
|
||||
l->gsl_creatingXid = GetCurrentTransactionId();
|
||||
l->gsl_next = GISTScans;
|
||||
GISTScans = l;
|
||||
}
|
||||
@ -271,6 +273,46 @@ AtEOXact_gist(void)
|
||||
GISTScans = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* AtEOSubXact_gist() --- clean up gist subsystem at subxact abort or commit.
|
||||
*
|
||||
* This is here because it needs to touch this module's static var GISTScans.
|
||||
*/
|
||||
void
|
||||
AtEOSubXact_gist(TransactionId childXid)
|
||||
{
|
||||
GISTScanList l;
|
||||
GISTScanList prev;
|
||||
GISTScanList next;
|
||||
|
||||
/*
|
||||
* Note: these actions should only be necessary during xact abort; but
|
||||
* they can't hurt during a commit.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Forget active scans that were started in this subtransaction.
|
||||
*/
|
||||
prev = NULL;
|
||||
|
||||
for (l = GISTScans; l != NULL; l = next)
|
||||
{
|
||||
next = l->gsl_next;
|
||||
if (l->gsl_creatingXid == childXid)
|
||||
{
|
||||
if (prev == NULL)
|
||||
GISTScans = next;
|
||||
else
|
||||
prev->gsl_next = next;
|
||||
|
||||
pfree(l);
|
||||
/* prev does not change */
|
||||
}
|
||||
else
|
||||
prev = l;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gistadjscans(Relation rel, int op, BlockNumber blkno, OffsetNumber offnum)
|
||||
{
|
||||
|
Reference in New Issue
Block a user