pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Guo <rguo@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add explicit initialization for all PlannerGlobal fields
Date: Wed, 14 May 2025 01:00:10 +0000
Message-ID: <E1uF0Th-001Ynq-2l@gemulon.postgresql.org> (raw)

Add explicit initialization for all PlannerGlobal fields

When creating a new PlannerGlobal node in standard_planner(), most
fields are explicitly initialized, but a few are not.  This doesn't
cause any functional issues, as makeNode() zeroes all fields by
default.  However, the inconsistency is undesirable from a clarity and
maintenance perspective.

This patch explicitly initializes the remaining fields to improve
consistency and readability.

Author: Richard Guo <guofenglinux@gmail.com>
Reviewed-by: David Rowley <dgrowleyml@gmail.com>
Discussion: https://postgr.es/m/CAMbWs4-TgQHNOiouqGcuHoBqbJjWyx4UxGKxUY3FrF4trGbcPA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2c0ed86d393670c7054d051490063de771f1791e

Modified Files
--------------
src/backend/optimizer/plan/planner.c | 5 +++++
1 file changed, 5 insertions(+)



Message-ID: <E1uF0Th-001Ynq-2l@gemulon.postgresql.org>
Permalink:  ../E1uF0Th-001Ynq-2l@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1uF0Th-001Ynq-2l@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rguo@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add explicit initialization for all PlannerGlobal fields
  In-Reply-To: <E1uF0Th-001Ynq-2l@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox