pgsql: Ensure that a cursor has an immutable snapshot throughout its - Mailing list pgsql-committers

From alvherre@postgresql.org (Alvaro Herrera)
Subject pgsql: Ensure that a cursor has an immutable snapshot throughout its
Date
Msg-id 20091002175821.93B82753FBC@cvs.postgresql.org
Whole thread Raw
List 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:

Previous
From: alvherre@postgresql.org (Alvaro Herrera)
Date:
Subject: pgsql: Ensure that a cursor has an immutable snapshot throughout its
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix erroneous handling of shared dependencies (ie dependencies on