diff options
| author | Tom Lane | 2002-05-21 22:05:55 +0000 |
|---|---|---|
| committer | Tom Lane | 2002-05-21 22:05:55 +0000 |
| commit | 959e61e917a802074e257d4bec13ee04ab4822ff (patch) | |
| tree | 880e848a4b330587976ae3502164dc6e0c874ca4 /src/include/access | |
| parent | 0a2682445ebad57f911ed52f0634d1520164c319 (diff) | |
Remove global variable scanCommandId in favor of storing a command ID
in snapshots, per my proposal of a few days ago. Also, tweak heapam.c
routines (heap_insert, heap_update, heap_delete, heap_mark4update) to
be passed the command ID to use, instead of doing GetCurrentCommandID.
For catalog updates they'll still get passed current command ID, but
for updates generated from the main executor they'll get passed the
command ID saved in the snapshot the query is using. This should fix
some corner cases associated with functions and triggers that advance
current command ID while an outer query is still in progress.
Diffstat (limited to 'src/include/access')
| -rw-r--r-- | src/include/access/heapam.h | 19 | ||||
| -rw-r--r-- | src/include/access/xact.h | 6 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index b8f2394fc54..7bf75f512d3 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: heapam.h,v 1.74 2002/05/20 23:51:43 tgl Exp $ + * $Id: heapam.h,v 1.75 2002/05/21 22:05:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -156,16 +156,23 @@ extern void heap_fetch(Relation relation, Snapshot snapshot, HeapTuple tuple, Buffer *userbuf, PgStat_Info *pgstat_info); -extern ItemPointer heap_get_latest_tid(Relation relation, Snapshot snapshot, ItemPointer tid); +extern ItemPointer heap_get_latest_tid(Relation relation, Snapshot snapshot, + ItemPointer tid); extern void setLastTid(const ItemPointer tid); -extern Oid heap_insert(Relation relation, HeapTuple tup); -extern int heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid); + +extern Oid heap_insert(Relation relation, HeapTuple tup, CommandId cid); +extern int heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid, + CommandId cid); extern int heap_update(Relation relation, ItemPointer otid, HeapTuple tup, - ItemPointer ctid); -extern int heap_mark4update(Relation relation, HeapTuple tup, Buffer *userbuf); + ItemPointer ctid, CommandId cid); +extern int heap_mark4update(Relation relation, HeapTuple tup, + Buffer *userbuf, CommandId cid); + +extern Oid simple_heap_insert(Relation relation, HeapTuple tup); extern void simple_heap_delete(Relation relation, ItemPointer tid); extern void simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup); + extern void heap_markpos(HeapScanDesc scan); extern void heap_restrpos(HeapScanDesc scan); diff --git a/src/include/access/xact.h b/src/include/access/xact.h index 0cfc1652f22..537d84b63db 100644 --- a/src/include/access/xact.h +++ b/src/include/access/xact.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: xact.h,v 1.42 2002/04/01 03:34:27 tgl Exp $ + * $Id: xact.h,v 1.43 2002/05/21 22:05:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -38,7 +38,6 @@ typedef struct TransactionStateData { TransactionId transactionIdData; CommandId commandId; - CommandId scanCommandId; AbsoluteTime startTime; int startTimeUsec; int state; @@ -101,13 +100,10 @@ extern bool IsTransactionState(void); extern bool IsAbortedTransactionBlockState(void); extern TransactionId GetCurrentTransactionId(void); extern CommandId GetCurrentCommandId(void); -extern CommandId GetScanCommandId(void); -extern void SetScanCommandId(CommandId); extern AbsoluteTime GetCurrentTransactionStartTime(void); extern AbsoluteTime GetCurrentTransactionStartTimeUsec(int *usec); extern bool TransactionIdIsCurrentTransactionId(TransactionId xid); extern bool CommandIdIsCurrentCommandId(CommandId cid); -extern bool CommandIdGEScanCommandId(CommandId cid); extern void CommandCounterIncrement(void); extern void StartTransactionCommand(void); extern void CommitTransactionCommand(void); |
