1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-03 20:02:46 +03:00

Use Snapshot in heap access methods.

This commit is contained in:
Vadim B. Mikheev
1998-07-27 19:38:40 +00:00
parent f7f989c990
commit be8300b18f
54 changed files with 352 additions and 339 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.18 1998/06/15 19:28:22 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/nodeIndexscan.c,v 1.19 1998/07/27 19:37:57 vadim Exp $
*
*-------------------------------------------------------------------------
*/
@ -85,7 +85,8 @@ IndexNext(IndexScan *node)
EState *estate;
CommonScanState *scanstate;
IndexScanState *indexstate;
ScanDirection direction;
ScanDirection direction;
Snapshot snapshot;
int indexPtr;
IndexScanDescPtr scanDescs;
IndexScanDesc scandesc;
@ -101,6 +102,7 @@ IndexNext(IndexScan *node)
*/
estate = node->scan.plan.state;
direction = estate->es_direction;
snapshot = estate->es_snapshot;
scanstate = node->scan.scanstate;
indexstate = node->indxstate;
indexPtr = indexstate->iss_IndexPtr;
@ -122,7 +124,8 @@ IndexNext(IndexScan *node)
*/
while ((result = index_getnext(scandesc, direction)) != NULL)
{
tuple = heap_fetch(heapRelation, false, &result->heap_iptr, &buffer);
tuple = heap_fetch(heapRelation, snapshot,
&result->heap_iptr, &buffer);
/* be tidy */
pfree(result);
@ -920,6 +923,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
(ScanKey) NULL, /* scan key */
0, /* is index */
direction, /* scan direction */
estate->es_snapshot, /* */
&currentRelation, /* return: rel desc */
(Pointer *) &currentScanDesc); /* return: scan desc */
@ -958,6 +962,7 @@ ExecInitIndexScan(IndexScan *node, EState *estate, Plan *parent)
scanKeys[i], /* scan key */
true, /* is index */
direction, /* scan direction */
estate->es_snapshot,
&(relationDescs[i]), /* return: rel desc */
(Pointer *) &(scanDescs[i]));
/* return: scan desc */