mirror of
https://github.com/postgres/postgres.git
synced 2025-12-22 17:42:17 +03:00
Ensure that a cursor has an immutable snapshot throughout its lifespan.
The old coding was using a regular snapshot, referenced elsewhere, that was subject to having its command counter updated. Fix by creating a private copy of the snapshot exclusively for the cursor. Backpatch to 8.4, which is when the bug was introduced during the snapshot management rewrite.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/snapmgr.h,v 1.5 2009/06/11 14:49:13 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/snapmgr.h,v 1.6 2009/10/02 17:57:30 alvherre Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -26,6 +26,7 @@ extern TransactionId RecentGlobalXmin;
|
||||
extern Snapshot GetTransactionSnapshot(void);
|
||||
extern Snapshot GetLatestSnapshot(void);
|
||||
extern void SnapshotSetCommandId(CommandId curcid);
|
||||
extern Snapshot CopySnapshot(Snapshot snapshot);
|
||||
|
||||
extern void PushActiveSnapshot(Snapshot snapshot);
|
||||
extern void PushUpdatedSnapshot(Snapshot snapshot);
|
||||
|
||||
Reference in New Issue
Block a user