mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-28 09:46:44 +08:00
Use saved snapshot for scanner
When scan is started using `ts_scanner_start_scan` it create a snapshot to use when scanning the data, but this is not subsequently used in `ts_scanner_next`. This commit fixes this by using the already created snapshot instead of calling `GetLastSnapshot()`.
This commit is contained in:
parent
e058236311
commit
81ed667392
@ -295,10 +295,10 @@ ts_scanner_next(ScannerCtx *ctx, InternalScannerCtx *ictx)
|
||||
#if PG12_GE
|
||||
TupleTableSlot *slot = ictx->tinfo.slot;
|
||||
|
||||
PushActiveSnapshot(GetLatestSnapshot());
|
||||
Assert(ctx->snapshot);
|
||||
ictx->tinfo.lockresult = table_tuple_lock(ictx->tablerel,
|
||||
&(slot->tts_tid),
|
||||
GetLatestSnapshot(),
|
||||
ctx->snapshot,
|
||||
slot,
|
||||
GetCurrentCommandId(false),
|
||||
ctx->tuplock->lockmode,
|
||||
@ -306,7 +306,6 @@ ts_scanner_next(ScannerCtx *ctx, InternalScannerCtx *ictx)
|
||||
0 /* don't follow updates */,
|
||||
&tmfd);
|
||||
|
||||
PopActiveSnapshot();
|
||||
#else
|
||||
HeapTuple tuple = ExecFetchSlotTuple(ictx->tinfo.slot);
|
||||
Buffer buffer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user