Re: PgStat_HashKey padding issue when passed by reference

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: PgStat_HashKey padding issue when passed by reference
Дата
Msg-id aL-Q8CC5KscJS_Oq@paquier.xyz
обсуждение исходный текст
Ответ на Re: PgStat_HashKey padding issue when passed by reference  (Sami Imseih <samimseih@gmail.com>)
Ответы Re: PgStat_HashKey padding issue when passed by reference
Список pgsql-hackers
On Mon, Sep 08, 2025 at 09:20:14PM -0500, Sami Imseih wrote:
> The following will fail the assert since padding is needed for the
> new Oid member.
>
> @@ -53,6 +53,7 @@ typedef struct PgStat_HashKey
>  {
>         PgStat_Kind kind;                       /* statistics entry kind */
>         Oid                     dboid;                  /* database
> ID. InvalidOid for shared objects. */
> +       Oid                 field1;
>         uint64          objid;                  /* object ID (table,
> function, etc.), or
>
> This will not fail the assert, since no padding is needed for the new member.
>
> @@ -53,6 +53,7 @@ typedef struct PgStat_HashKey
>  {
>         PgStat_Kind kind;                       /* statistics entry kind */
>         Oid                     dboid;                  /* database
> ID. InvalidOid for shared objects. */
> +       uint64          field1;
>         uint64          objid;                  /* object ID (table,
> function, etc.), or

Exactly.  Hence my proposal of static assertion is doing exactly the
job I want it to do :)
--
Michael

Вложения

В списке pgsql-hackers по дате отправления: