mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user