@@ -82,7 +82,7 @@ text_to_bits(char *str, int len)
8282else
8383ereport (ERROR ,
8484(errcode (ERRCODE_DATA_CORRUPTED ),
85- errmsg ("illegal character '%c' in t_bits string" ,str [off ])));
85+ errmsg ("illegal character '%c' in t_bits string" ,str [off ])));
8686
8787if (off %8 == 7 )
8888bits [off /8 ]= byte ;
@@ -192,9 +192,9 @@ heap_page_items(PG_FUNCTION_ARGS)
192192lp_offset == MAXALIGN (lp_offset )&&
193193lp_offset + lp_len <=raw_page_size )
194194{
195- HeapTupleHeader tuphdr ;
196- bytea * tuple_data_bytea ;
197- int tuple_data_len ;
195+ HeapTupleHeader tuphdr ;
196+ bytea * tuple_data_bytea ;
197+ int tuple_data_len ;
198198
199199/* Extract information from the tuple header */
200200
@@ -214,7 +214,7 @@ heap_page_items(PG_FUNCTION_ARGS)
214214tuple_data_bytea = (bytea * )palloc (tuple_data_len + VARHDRSZ );
215215SET_VARSIZE (tuple_data_bytea ,tuple_data_len + VARHDRSZ );
216216memcpy (VARDATA (tuple_data_bytea ), (char * )tuphdr + tuphdr -> t_hoff ,
217- tuple_data_len );
217+ tuple_data_len );
218218values [13 ]= PointerGetDatum (tuple_data_bytea );
219219
220220/*
@@ -284,16 +284,16 @@ heap_page_items(PG_FUNCTION_ARGS)
284284 */
285285static Datum
286286tuple_data_split_internal (Oid relid ,char * tupdata ,
287- uint16 tupdata_len ,uint16 t_infomask ,
288- uint16 t_infomask2 ,bits8 * t_bits ,
289- bool do_detoast )
287+ uint16 tupdata_len ,uint16 t_infomask ,
288+ uint16 t_infomask2 ,bits8 * t_bits ,
289+ bool do_detoast )
290290{
291- ArrayBuildState * raw_attrs ;
292- int nattrs ;
293- int i ;
294- int off = 0 ;
295- Relation rel ;
296- TupleDesc tupdesc ;
291+ ArrayBuildState * raw_attrs ;
292+ int nattrs ;
293+ int i ;
294+ int off = 0 ;
295+ Relation rel ;
296+ TupleDesc tupdesc ;
297297
298298/* Get tuple descriptor from relation OID */
299299rel = relation_open (relid ,NoLock );
@@ -310,30 +310,31 @@ tuple_data_split_internal(Oid relid, char *tupdata,
310310
311311for (i = 0 ;i < nattrs ;i ++ )
312312{
313- Form_pg_attribute attr ;
314- bool is_null ;
315- bytea * attr_data = NULL ;
313+ Form_pg_attribute attr ;
314+ bool is_null ;
315+ bytea * attr_data = NULL ;
316316
317317attr = tupdesc -> attrs [i ];
318318is_null = (t_infomask & HEAP_HASNULL )&& att_isnull (i ,t_bits );
319319
320320/*
321- * Tuple header can specify less attributes than tuple descriptor
322- *as ALTER TABLE ADD COLUMN without DEFAULT keyword does not
323- *actually change tuples in pages, so attributes with numbers greater
324- *than (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
321+ * Tuple header can specify less attributes than tuple descriptor as
322+ * ALTER TABLE ADD COLUMN without DEFAULT keyword does not actually
323+ * change tuples in pages, so attributes with numbers greater than
324+ * (t_infomask2 & HEAP_NATTS_MASK) should be treated as NULL.
325325 */
326326if (i >= (t_infomask2 & HEAP_NATTS_MASK ))
327327is_null = true;
328328
329329if (!is_null )
330330{
331- int len ;
331+ int len ;
332332
333333if (attr -> attlen == -1 )
334334{
335335off = att_align_pointer (off ,tupdesc -> attrs [i ]-> attalign ,-1 ,
336336tupdata + off );
337+
337338/*
338339 * As VARSIZE_ANY throws an exception if it can't properly
339340 * detect the type of external storage in macros VARTAG_SIZE,
@@ -343,8 +344,8 @@ tuple_data_split_internal(Oid relid, char *tupdata,
343344!VARATT_IS_EXTERNAL_ONDISK (tupdata + off )&&
344345!VARATT_IS_EXTERNAL_INDIRECT (tupdata + off ))
345346ereport (ERROR ,
346- (errcode (ERRCODE_DATA_CORRUPTED ),
347- errmsg ("first byte of varlena attribute is incorrect for attribute %d" ,i )));
347+ (errcode (ERRCODE_DATA_CORRUPTED ),
348+ errmsg ("first byte of varlena attribute is incorrect for attribute %d" ,i )));
348349
349350len = VARSIZE_ANY (tupdata + off );
350351}
@@ -381,7 +382,7 @@ tuple_data_split_internal(Oid relid, char *tupdata,
381382if (tupdata_len != off )
382383ereport (ERROR ,
383384(errcode (ERRCODE_DATA_CORRUPTED ),
384- errmsg ("end of tuple reached without looking at all its data" )));
385+ errmsg ("end of tuple reached without looking at all its data" )));
385386
386387return makeArrayResult (raw_attrs ,CurrentMemoryContext );
387388}
@@ -397,14 +398,14 @@ PG_FUNCTION_INFO_V1(tuple_data_split);
397398Datum
398399tuple_data_split (PG_FUNCTION_ARGS )
399400{
400- Oid relid ;
401- bytea * raw_data ;
402- uint16 t_infomask ;
403- uint16 t_infomask2 ;
404- char * t_bits_str ;
405- bool do_detoast = false;
406- bits8 * t_bits = NULL ;
407- Datum res ;
401+ Oid relid ;
402+ bytea * raw_data ;
403+ uint16 t_infomask ;
404+ uint16 t_infomask2 ;
405+ char * t_bits_str ;
406+ bool do_detoast = false;
407+ bits8 * t_bits = NULL ;
408+ Datum res ;
408409
409410relid = PG_GETARG_OID (0 );
410411raw_data = PG_ARGISNULL (1 ) ?NULL :PG_GETARG_BYTEA_P (1 );
@@ -430,8 +431,8 @@ tuple_data_split(PG_FUNCTION_ARGS)
430431 */
431432if (t_infomask & HEAP_HASNULL )
432433{
433- int bits_str_len ;
434- int bits_len ;
434+ int bits_str_len ;
435+ int bits_len ;
435436
436437bits_len = (t_infomask2 & HEAP_NATTS_MASK ) /8 + 1 ;
437438if (!t_bits_str )