Skip site navigation (1) Skip section navigation (2)

pgsql: Ensure that a cursor has an immutable snapshot throughout its

From: alvherre(at)postgresql(dot)org (Alvaro Herrera)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Ensure that a cursor has an immutable snapshot throughout its
Date: 2009-10-02 17:58:21
Message-ID: 20091002175821.93B82753FBC@cvs.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
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.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/commands:
        portalcmds.c (r1.79 -> r1.79.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/portalcmds.c?r1=1.79&r2=1.79.2.1)
    pgsql/src/backend/executor:
        spi.c (r1.208 -> r1.208.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/spi.c?r1=1.208&r2=1.208.2.1)
    pgsql/src/backend/utils/time:
        snapmgr.c (r1.10 -> r1.10.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/time/snapmgr.c?r1=1.10&r2=1.10.2.1)
    pgsql/src/include/utils:
        snapmgr.h (r1.5 -> r1.5.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/snapmgr.h?r1=1.5&r2=1.5.2.1)
    pgsql/src/test/regress/expected:
        portals.out (r1.21 -> r1.21.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/portals.out?r1=1.21&r2=1.21.2.1)
    pgsql/src/test/regress/sql:
        portals.sql (r1.16 -> r1.16.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/portals.sql?r1=1.16&r2=1.16.2.1)

pgsql-committers by date

Next:From: Tom LaneDate: 2009-10-02 18:13:04
Subject: pgsql: Fix erroneous handling of shared dependencies (ie dependencies on
Previous:From: Alvaro HerreraDate: 2009-10-02 17:57:30
Subject: pgsql: Ensure that a cursor has an immutable snapshot throughout its

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group