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:
@ -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, /* */
|
||||
¤tRelation, /* return: rel desc */
|
||||
(Pointer *) ¤tScanDesc); /* 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 */
|
||||
|
Reference in New Issue
Block a user