diff options
author | Richard Guo <rguo@postgresql.org> | 2025-05-14 09:59:31 +0900 |
---|---|---|
committer | Richard Guo <rguo@postgresql.org> | 2025-05-14 09:59:31 +0900 |
commit | 2c0ed86d393670c7054d051490063de771f1791e (patch) | |
tree | 7420f271aa8e04da751e0bde88a62a52faffcc95 | |
parent | 6e289f2d5da02b450f00fb57f0facc60bd73c0d1 (diff) | |
download | postgresql-2c0ed86d393670c7054d051490063de771f1791e.tar.gz postgresql-2c0ed86d393670c7054d051490063de771f1791e.zip |
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
-rw-r--r-- | src/backend/optimizer/plan/planner.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c index beafac8c0b0..49ad6e83578 100644 --- a/src/backend/optimizer/plan/planner.c +++ b/src/backend/optimizer/plan/planner.c @@ -326,10 +326,14 @@ standard_planner(Query *parse, const char *query_string, int cursorOptions, glob->subroots = NIL; glob->rewindPlanIDs = NULL; glob->finalrtable = NIL; + glob->allRelids = NULL; + glob->prunableRelids = NULL; glob->finalrteperminfos = NIL; glob->finalrowmarks = NIL; glob->resultRelations = NIL; + glob->firstResultRels = NIL; glob->appendRelations = NIL; + glob->partPruneInfos = NIL; glob->relationOids = NIL; glob->invalItems = NIL; glob->paramExecTypes = NIL; @@ -338,6 +342,7 @@ standard_planner(Query *parse, const char *query_string, int cursorOptions, glob->lastPlanNodeId = 0; glob->transientPlan = false; glob->dependsOnRole = false; + glob->partition_directory = NULL; /* * Assess whether it's feasible to use parallel mode for this query. We |