aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/optimizer/path/allpaths.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 8a193cfea37..5682fd276ed 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -4240,12 +4240,24 @@ generate_partitionwise_join_paths(PlannerInfo *root, RelOptInfo *rel)
if (child_rel == NULL)
continue;
- /* Add partitionwise join paths for partitioned child-joins. */
+ /* Make partitionwise join paths for this partitioned child-join. */
generate_partitionwise_join_paths(root, child_rel);
+ /* If we failed to make any path for this child, we must give up. */
+ if (child_rel->pathlist == NIL)
+ {
+ /*
+ * Mark the parent joinrel as unpartitioned so that later
+ * functions treat it correctly.
+ */
+ rel->nparts = 0;
+ return;
+ }
+
+ /* Else, identify the cheapest path for it. */
set_cheapest(child_rel);
- /* Dummy children will not be scanned, so ignore those. */
+ /* Dummy children need not be scanned, so ignore those. */
if (IS_DUMMY_REL(child_rel))
continue;