Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c0ed86

Browse files
author
Richard Guo
committed
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 <[email protected]> Reviewed-by: David Rowley <[email protected]> Discussion: https://postgr.es/m/CAMbWs4-TgQHNOiouqGcuHoBqbJjWyx4UxGKxUY3FrF4trGbcPA@mail.gmail.com
1 parent 6e289f2 commit 2c0ed86

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/backend/optimizer/plan/planner.c

+5
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,14 @@ standard_planner(Query *parse, const char *query_string, int cursorOptions,
326326
glob->subroots = NIL;
327327
glob->rewindPlanIDs = NULL;
328328
glob->finalrtable = NIL;
329+
glob->allRelids = NULL;
330+
glob->prunableRelids = NULL;
329331
glob->finalrteperminfos = NIL;
330332
glob->finalrowmarks = NIL;
331333
glob->resultRelations = NIL;
334+
glob->firstResultRels = NIL;
332335
glob->appendRelations = NIL;
336+
glob->partPruneInfos = NIL;
333337
glob->relationOids = NIL;
334338
glob->invalItems = NIL;
335339
glob->paramExecTypes = NIL;
@@ -338,6 +342,7 @@ standard_planner(Query *parse, const char *query_string, int cursorOptions,
338342
glob->lastPlanNodeId = 0;
339343
glob->transientPlan = false;
340344
glob->dependsOnRole = false;
345+
glob->partition_directory = NULL;
341346

342347
/*
343348
* Assess whether it's feasible to use parallel mode for this query. We

0 commit comments

Comments
 (0)