Hi,
On 10/27/23 8:07 AM, Michael Paquier wrote:
>
> The part that I found disturbing is here:
> + tabentry = (PgStat_TableStatus *) entry_ref->pending;
> + tablestatus = palloc(sizeof(PgStat_TableStatus));
> + *tablestatus = *tabentry;
>
> This causes tablestatus->trans to point to the same location as
> tabentry->trans, but wouldn't it be better to set tablestatus->trans
> to NULL instead for the copy returned to the caller?
Oh I see, yeah I do agree to set tablestatus->trans to NULL to avoid
any undesired interference with tabentry->trans.
Done in V8 attached (pgindent has been run on pgstatfuncs.c and
pgstat_relation.c).
Regards,
--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com