Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 765ad89

Browse files
committed
Use InvalidSnapshot, now SnapshotNow, as the default snapshot.
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.
1 parent e605506 commit 765ad89

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/access/index/genam.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ RelationGetIndexScan(Relation indexRelation, int nkeys, int norderbys)
7979

8080
scan->heapRelation = NULL; /* may be set later */
8181
scan->indexRelation = indexRelation;
82-
scan->xs_snapshot = SnapshotNow; /* may be set later */
82+
scan->xs_snapshot = InvalidSnapshot; /* caller must initialize this */
8383
scan->numberOfKeys = nkeys;
8484
scan->numberOfOrderBys = norderbys;
8585

src/backend/executor/execUtils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ CreateExecutorState(void)
105105
* Initialize all fields of the Executor State structure
106106
*/
107107
estate->es_direction = ForwardScanDirection;
108-
estate->es_snapshot = SnapshotNow;
108+
estate->es_snapshot = InvalidSnapshot; /* caller must initialize this */
109109
estate->es_crosscheck_snapshot = InvalidSnapshot; /* no crosscheck */
110110
estate->es_range_table = NIL;
111111
estate->es_plannedstmt = NULL;

0 commit comments

Comments
 (0)