On 2015-05-21 15:34:00 -0400, Tom Lane wrote:
> Piotr Stefaniak <[email protected]> writes:
> > But due to how ExecRowMark struct is laid out in memory, the packed
> > struct ItemPointerData begins at an uneven offset, leading to misaligned
> > access whenever BlockIdData is set by ItemPointerSetInvalid() (and
> > likely in some other places, too).
>
> But BlockIdData is laid out and accessed as two 16-bit fields, so there
> should be no problem. On what platform exactly do you see a failure?
It's probably aligned on a byte boundary:
typedef struct ExecRowMark
{
Relation relation; /* opened and suitably locked
relation */
Index rti; /* its range table index */
Index prti; /* parent range table index, if
child */
Index rowmarkId; /* unique identifier for
resjunk columns */
RowMarkType markType; /* see enum in nodes/plannodes.h */
bool noWait; /* NOWAIT option */
ItemPointerData curCtid; /* ctid of currently locked tuple, if
any */
} ExecRowMark;
due to the packedness curCtid will quite possibly be stored without any
padding after after noWait.
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers