From 6b9c6516f469f312c91a79ed5e93344dd3300983 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 14 Feb 2022 21:41:27 -0800 Subject: [PATCH] Improved code --- src/ivfscan.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ivfscan.c b/src/ivfscan.c index 958faae..aa41275 100644 --- a/src/ivfscan.c +++ b/src/ivfscan.c @@ -310,12 +310,13 @@ ivfflatgettuple(IndexScanDesc scan, ScanDirection dir) if (tuplesort_gettupleslot(so->sortstate, true, so->slot, NULL)) #endif { + ItemPointer tid = (ItemPointer) DatumGetPointer(slot_getattr(so->slot, 2, &so->isnull)); BlockNumber indexblkno = DatumGetInt32(slot_getattr(so->slot, 3, &so->isnull)); #if PG_VERSION_NUM >= 120000 - scan->xs_heaptid = *((ItemPointer) DatumGetPointer(slot_getattr(so->slot, 2, &so->isnull))); + scan->xs_heaptid = *tid; #else - scan->xs_ctup.t_self = *((ItemPointer) DatumGetPointer(slot_getattr(so->slot, 2, &so->isnull))); + scan->xs_ctup.t_self = *tid; #endif if (BufferIsValid(so->buf))