]> granicus.if.org Git - postgresql/commitdiff
Use InvalidSnapshot, now SnapshotNow, as the default snapshot.
authorRobert Haas <rhaas@postgresql.org>
Tue, 23 Jul 2013 14:58:32 +0000 (10:58 -0400)
committerRobert Haas <rhaas@postgresql.org>
Tue, 23 Jul 2013 14:58:32 +0000 (10:58 -0400)
As far as I can determine, there's no code in the core distribution
that fails to explicitly set the snapshot of a scan or executor
state.  If there is any such code, this will probably cause it to
seg fault; friendlier suggestions were discussed on pgsql-hackers,
but there was no consensus that anything more than this was
needed.

This is another step towards the hoped-for complete removal of
SnapshotNow.

src/backend/access/index/genam.c
src/backend/executor/execUtils.c

index 60a2b4e43898e69b3a112f2bd6ac75b2c92bc4be..15debedf40689e771f7689161dd9503cddb69764 100644 (file)
@@ -79,7 +79,7 @@ RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
 
        scan->heapRelation = NULL;      /* may be set later */
        scan->indexRelation = indexRelation;
-       scan->xs_snapshot = SnapshotNow;        /* may be set later */
+       scan->xs_snapshot = InvalidSnapshot;    /* caller must initialize this */
        scan->numberOfKeys = nkeys;
        scan->numberOfOrderBys = norderbys;
 
index b449e0a55343c2c2fe5008218778149442caf734..39e3b2e79c8036f9a5bfa95b1f1732c4894ffe6b 100644 (file)
@@ -105,7 +105,7 @@ CreateExecutorState(void)
         * Initialize all fields of the Executor State structure
         */
        estate->es_direction = ForwardScanDirection;
-       estate->es_snapshot = SnapshotNow;
+       estate->es_snapshot = InvalidSnapshot;  /* caller must initialize this */
        estate->es_crosscheck_snapshot = InvalidSnapshot;       /* no crosscheck */
        estate->es_range_table = NIL;
        estate->es_plannedstmt = NULL;