diff options
author | Robert Haas | 2016-06-09 22:02:36 +0000 |
---|---|---|
committer | Robert Haas | 2016-06-09 22:02:36 +0000 |
commit | 4bc424b968058c7f0aa685821d7039e86faac99c (patch) | |
tree | a4e245ae67bd11edb3926ff5fb3b0223438ac283 /contrib/pageinspect/heapfuncs.c | |
parent | 9164deea2f4ac90ee5e008ff41fc5ad4423887b2 (diff) |
pgindent run for 9.6
Diffstat (limited to 'contrib/pageinspect/heapfuncs.c')
-rw-r--r-- | contrib/pageinspect/heapfuncs.c | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index d0c28865c3f..904eaef2dab 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -82,7 +82,7 @@ text_to_bits(char *str, int len) else ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("illegal character '%c' in t_bits string", str[off]))); + errmsg("illegal character '%c' in t_bits string", str[off]))); if (off % 8 == 7) bits[off / 8] = byte; @@ -192,9 +192,9 @@ heap_page_items(PG_FUNCTION_ARGS) lp_offset == MAXALIGN(lp_offset) && lp_offset + lp_len <= raw_page_size) { - HeapTupleHeader tuphdr; - bytea *tuple_data_bytea; - int tuple_data_len; + HeapTupleHeader tuphdr; + bytea *tuple_data_bytea; + int tuple_data_len; /* Extract information from the tuple header */ @@ -214,7 +214,7 @@ heap_page_items(PG_FUNCTION_ARGS) tuple_data_bytea = (bytea *) palloc(tuple_data_len + VARHDRSZ); SET_VARSIZE(tuple_data_bytea, tuple_data_len + VARHDRSZ); memcpy(VARDATA(tuple_data_bytea), (char *) tuphdr + tuphdr->t_hoff, - tuple_data_len); + tuple_data_len); values[13] = PointerGetDatum(tuple_data_bytea); /* @@ -284,16 +284,16 @@ heap_page_items(PG_FUNCTION_ARGS) */ static Datum tuple_data_split_internal(Oid relid, char *tupdata, - uint16 tupdata_len, uint16 t_infomask, - uint16 t_infomask2, bits8 *t_bits, - bool do_detoast) + uint16 tupdata_len, uint16 t_infomask, + uint16 t_infomask2, bits8 *t_bits, + bool do_detoast) { - ArrayBuildState *raw_attrs; - int nattrs; - int i; - int off = 0; - Relation rel; - TupleDesc tupdesc; + ArrayBuildState *raw_attrs; + int nattrs; + int i; + int off = 0; + Relation rel; + TupleDesc tupdesc; /* Get tuple descriptor from relation OID */ rel = relation_open(relid, NoLock); @@ -310,30 +310,31 @@ tuple_data_split_internal(Oid relid, char *tupdata, for (i = 0; i < nattrs; i++) { - Form_pg_attribute attr; - bool is_null; - bytea *attr_data = NULL; + Form_pg_attribute attr; + bool is_null; + bytea *attr_data = NULL; attr = tupdesc->attrs[i]; is_null = (t_infomask & HEAP_HASNULL) && att_isnull(i, t_bits); /* - * Tuple header can specify less attributes than tuple descriptor - * as ALTER TABLE ADD COLUMN without DEFAULT keyword does not - * actually change tuples in pages, so attributes with numbers greater - * than (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL. + * Tuple header can specify less attributes than tuple descriptor as + * ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually + * change tuples in pages, so attributes with numbers greater than + * (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL. */ if (i >= (t_infomask2 & HEAP_NATTS_MASK)) is_null = true; if (!is_null) { - int len; + int len; if (attr->attlen == -1) { off = att_align_pointer(off, tupdesc->attrs[i]->attalign, -1, tupdata + off); + /* * As VARSIZE_ANY throws an exception if it can't properly * detect the type of external storage in macros VARTAG_SIZE, @@ -343,8 +344,8 @@ tuple_data_split_internal(Oid relid, char *tupdata, !VARATT_IS_EXTERNAL_ONDISK(tupdata + off) && !VARATT_IS_EXTERNAL_INDIRECT(tupdata + off)) ereport(ERROR, - (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("first byte of varlena attribute is incorrect for attribute %d", i))); + (errcode(ERRCODE_DATA_CORRUPTED), + errmsg("first byte of varlena attribute is incorrect for attribute %d", i))); len = VARSIZE_ANY(tupdata + off); } @@ -381,7 +382,7 @@ tuple_data_split_internal(Oid relid, char *tupdata, if (tupdata_len != off) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg("end of tuple reached without looking at all its data"))); + errmsg("end of tuple reached without looking at all its data"))); return makeArrayResult(raw_attrs, CurrentMemoryContext); } @@ -397,14 +398,14 @@ PG_FUNCTION_INFO_V1(tuple_data_split); Datum tuple_data_split(PG_FUNCTION_ARGS) { - Oid relid; - bytea *raw_data; - uint16 t_infomask; - uint16 t_infomask2; - char *t_bits_str; - bool do_detoast = false; - bits8 *t_bits = NULL; - Datum res; + Oid relid; + bytea *raw_data; + uint16 t_infomask; + uint16 t_infomask2; + char *t_bits_str; + bool do_detoast = false; + bits8 *t_bits = NULL; + Datum res; relid = PG_GETARG_OID(0); raw_data = PG_ARGISNULL(1) ? NULL : PG_GETARG_BYTEA_P(1); @@ -430,8 +431,8 @@ tuple_data_split(PG_FUNCTION_ARGS) */ if (t_infomask & HEAP_HASNULL) { - int bits_str_len; - int bits_len; + int bits_str_len; + int bits_len; bits_len = (t_infomask2 & HEAP_NATTS_MASK) / 8 + 1; if (!t_bits_str) |