aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2021-03-10 10:04:20 +0530
committerAmit Kapila <akapila@postgresql.org>2021-03-10 10:06:39 +0530
commite4e87a32cc5559303068b148bd4aa6a39b8f44a1 (patch)
tree94146b1291d0821d8935fd3bfb20b202916b86f1 /src
parent05c8482f7f69a954fd65fce85f896e848fc48197 (diff)
downloadpostgresql-e4e87a32cc5559303068b148bd4aa6a39b8f44a1.tar.gz
postgresql-e4e87a32cc5559303068b148bd4aa6a39b8f44a1.zip
Fix valgrind issue in commit 05c8482f7f.
Initialize other newly added variables in max_parallel_hazard_context via is_parallel_safe() because we don't check the parallel-safety of target relations in that function. Reported-by: Tom Lane as per buildfarm Author: Amit Kapila Discussion: https://postgr.es/m/2060179.1615347455@sss.pgh.pa.us
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/util/clauses.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
index 7ecdc783d57..7e25f94293e 100644
--- a/src/backend/optimizer/util/clauses.c
+++ b/src/backend/optimizer/util/clauses.c
@@ -614,9 +614,10 @@ is_parallel_safe(PlannerInfo *root, Node *node)
context.max_hazard = PROPARALLEL_SAFE;
context.max_interesting = PROPARALLEL_RESTRICTED;
context.safe_param_ids = NIL;
- context.command_type = node != NULL && IsA(node, Query) ?
- castNode(Query, node)->commandType : CMD_UNKNOWN;
- context.planner_global = root->glob;
+ /* We don't need to evaluate target relation's parallel-safety here. */
+ context.target_rte = NULL;
+ context.command_type = CMD_UNKNOWN;
+ context.planner_global = NULL;
/*
* The params that refer to the same or parent query level are considered