Add explicit initialization for all PlannerGlobal fields

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Add explicit initialization for all PlannerGlobal fields
Date: 2025-05-13 08:02:54
Message-ID: CAMbWs4-TgQHNOiouqGcuHoBqbJjWyx4UxGKxUY3FrF4trGbcPA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While adding a new field to PlannerGlobal in another patch, I noticed
that although most fields are explicitly initialized, a few are not.
This doesn't cause any functional issues, since makeNode() zeroes all
fields by default. However, the inconsistency stood out to me, so I
wrote the attached patch to explicitly initialize the remaining fields
for clarity and consistency.

Does this seem worthwhile? Or should we simply rely on makeNode() for
zero-initialization and consider this unnecessary?

Thanks
Richard

Attachment Content-Type Size
v1-0001-Add-explicit-initialization-for-all-PlannerGlobal.patch application/octet-stream 1.3 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message wenhui qiu 2025-05-13 09:34:33 Re: make VALIDATE domain constraint lock on related relations as ShareUpdateExclusiveLock
Previous Message Dilip Kumar 2025-05-13 06:22:47 Re: make VALIDATE domain constraint lock on related relations as ShareUpdateExclusiveLock