Fix valgrind issue in commit 05c8482f7f.
authorAmit Kapila <akapila@postgresql.org>
Wed, 10 Mar 2021 04:34:20 +0000 (10:04 +0530)
committerAmit Kapila <akapila@postgresql.org>
Wed, 10 Mar 2021 04:36:39 +0000 (10:06 +0530)
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

src/backend/optimizer/util/clauses.c

index 7ecdc783d579dcd86553da59b34e729798e086b3..7e25f94293e99e220dc4af5bd74e4338cd04f5b2 100644 (file)
@@ -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