Re: remove ATTRIBUTE_FIXED_PART_SIZE - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: remove ATTRIBUTE_FIXED_PART_SIZE
Date
Msg-id ec636b39-d401-937f-12c7-6fbdd888a44e@2ndquadrant.com
Whole thread Raw
In response to Re: remove ATTRIBUTE_FIXED_PART_SIZE  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 20/08/2018 12:46, Andres Freund wrote:
> static VacAttrStats *
> examine_attribute(Relation onerel, int attnum, Node *index_expr)
> {
> ...
>     /*
>      * Create the VacAttrStats struct.  Note that we only have a copy of the
>      * fixed fields of the pg_attribute tuple.
>      */
>     stats = (VacAttrStats *) palloc0(sizeof(VacAttrStats));
>     stats->attr = (Form_pg_attribute) palloc(ATTRIBUTE_FIXED_PART_SIZE);
>     memcpy(stats->attr, attr, ATTRIBUTE_FIXED_PART_SIZE);
> 
> Accesses to stats->attr can legitimately assume that the padding at the
> tail end of attr is present (i.e. widening a load / store).

Yeah, that's probably just broken.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: WaitForOlderSnapshots refactoring
Next
From: Andres Freund
Date:
Subject: Re: ALTER TABLE on system catalogs