aboutsummaryrefslogtreecommitdiff
path: root/contrib/pageinspect/heapfuncs.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2017-08-20 11:19:07 -0700
committerAndres Freund <andres@anarazel.de>2017-08-20 11:19:07 -0700
commit2cd70845240087da205695baedab6412342d1dbe (patch)
tree20a3b6a2231dae248218ac54983c7a854328265f /contrib/pageinspect/heapfuncs.c
parentb1c2d76a2fcef812af0be3343082414d401909c8 (diff)
downloadpostgresql-2cd70845240087da205695baedab6412342d1dbe.tar.gz
postgresql-2cd70845240087da205695baedab6412342d1dbe.zip
Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n).
This is a mechanical change in preparation for a later commit that will change the layout of TupleDesc. Introducing a macro to abstract the details of where attributes are stored will allow us to change that in separate step and revise it in future. Author: Thomas Munro, editorialized by Andres Freund Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CAEepm=0ZtQ-SpsgCyzzYpsXS6e=kZWqk3g5Ygn3MDV7A8dabUA@mail.gmail.com
Diffstat (limited to 'contrib/pageinspect/heapfuncs.c')
-rw-r--r--contrib/pageinspect/heapfuncs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c
index 72d1776a4a5..ca4d3f530f5 100644
--- a/contrib/pageinspect/heapfuncs.c
+++ b/contrib/pageinspect/heapfuncs.c
@@ -316,7 +316,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
bool is_null;
bytea *attr_data = NULL;
- attr = tupdesc->attrs[i];
+ attr = TupleDescAttr(tupdesc, i);
is_null = (t_infomask & HEAP_HASNULL) && att_isnull(i, t_bits);
/*
@@ -334,7 +334,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
if (attr->attlen == -1)
{
- off = att_align_pointer(off, tupdesc->attrs[i]->attalign, -1,
+ off = att_align_pointer(off, attr->attalign, -1,
tupdata + off);
/*
@@ -353,7 +353,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
}
else
{
- off = att_align_nominal(off, tupdesc->attrs[i]->attalign);
+ off = att_align_nominal(off, attr->attalign);
len = attr->attlen;
}
@@ -371,7 +371,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
memcpy(VARDATA(attr_data), tupdata + off, len);
}
- off = att_addlength_pointer(off, tupdesc->attrs[i]->attlen,
+ off = att_addlength_pointer(off, attr->attlen,
tupdata + off);
}