aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/snapmgr.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2009-10-02 17:58:21 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2009-10-02 17:58:21 +0000
commitae35363dced47a99178b4a4129e3ea1f990b829c (patch)
treec0a113330d1b9039764b82a1e59820c420b6fe7a /src/include/utils/snapmgr.h
parentd4bd8423c9939a30f0f29e70745917e4635b4973 (diff)
downloadpostgresql-ae35363dced47a99178b4a4129e3ea1f990b829c.tar.gz
postgresql-ae35363dced47a99178b4a4129e3ea1f990b829c.zip
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.
Diffstat (limited to 'src/include/utils/snapmgr.h')
-rw-r--r--src/include/utils/snapmgr.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/include/utils/snapmgr.h b/src/include/utils/snapmgr.h
index 979a52c6224..d2186116023 100644
--- a/src/include/utils/snapmgr.h
+++ b/src/include/utils/snapmgr.h
@@ -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.5.2.1 2009/10/02 17:58:21 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);