diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-10-02 17:57:30 +0000 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2009-10-02 17:57:30 +0000 |
commit | caa4cfa3697472a6673eb817eb34681684cba14f (patch) | |
tree | 8da52acab9865afa01f6771a33f3eb9a5952b6fa /src/backend/executor | |
parent | fabf75cffc34b187aba57b0d3a086ebec586d016 (diff) | |
download | postgresql-caa4cfa3697472a6673eb817eb34681684cba14f.tar.gz postgresql-caa4cfa3697472a6673eb817eb34681684cba14f.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/backend/executor')
-rw-r--r-- | src/backend/executor/spi.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/executor/spi.c b/src/backend/executor/spi.c index 40f43ee011b..8fc45360414 100644 --- a/src/backend/executor/spi.c +++ b/src/backend/executor/spi.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.208 2009/06/11 14:48:57 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/spi.c,v 1.209 2009/10/02 17:57:30 alvherre Exp $ * *------------------------------------------------------------------------- */ @@ -1211,10 +1211,7 @@ SPI_cursor_open_internal(const char *name, SPIPlanPtr plan, } } - /* - * Set up the snapshot to use. (PortalStart will do PushActiveSnapshot, - * so we skip that here.) - */ + /* Set up the snapshot to use. */ if (read_only) snapshot = GetActiveSnapshot(); else |