From ce96ce60ca2293f75f36c3661e4657a3c79ffd61 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 28 Mar 2017 12:52:55 -0300 Subject: Remove direct uses of ItemPointer.{ip_blkid,ip_posid} There are no functional changes here; this simply encapsulates knowledge of the ItemPointerData struct so that a future patch can change things without more breakage. All direct users of ip_blkid and ip_posid are changed to use existing macros ItemPointerGetBlockNumber and ItemPointerGetOffsetNumber respectively. For callers where that's inappropriate (because they Assert that the itempointer is is valid-looking), add ItemPointerGetBlockNumberNoCheck and ItemPointerGetOffsetNumberNoCheck, which lack the assertion but are otherwise identical. Author: Pavan Deolasee Discussion: https://postgr.es/m/CABOikdNnFon4cJiL=h1mZH3bgUeU+sWHuU4Yr8AB=j3A2p1GiA@mail.gmail.com --- contrib/pageinspect/btreefuncs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/pageinspect/btreefuncs.c') diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c index 6f35e288fd1..3d69aa9d37b 100644 --- a/contrib/pageinspect/btreefuncs.c +++ b/contrib/pageinspect/btreefuncs.c @@ -363,8 +363,8 @@ bt_page_items(PG_FUNCTION_ARGS) j = 0; values[j++] = psprintf("%d", uargs->offset); values[j++] = psprintf("(%u,%u)", - BlockIdGetBlockNumber(&(itup->t_tid.ip_blkid)), - itup->t_tid.ip_posid); + ItemPointerGetBlockNumberNoCheck(&itup->t_tid), + ItemPointerGetOffsetNumberNoCheck(&itup->t_tid)); values[j++] = psprintf("%d", (int) IndexTupleSize(itup)); values[j++] = psprintf("%c", IndexTupleHasNulls(itup) ? 't' : 'f'); values[j++] = psprintf("%c", IndexTupleHasVarwidths(itup) ? 't' : 'f'); -- cgit v1.2.3