diff options
author | Pavan Deolasee | 2017-07-31 12:06:38 +0000 |
---|---|---|
committer | Pavan Deolasee | 2017-07-31 12:06:38 +0000 |
commit | 29920dda095537f5ae7874086eb9537b9c5e5380 (patch) | |
tree | efb4e21f5d0a013da0e374d21ddf5c3d08a1c801 | |
parent | 295f3b607239153b22c1d2912e5140e54a8a4838 (diff) |
Copy distribution information correctly to ProjectSet path
ProjectSet is a new path type in PG 10 and we'd missed to copy the distribution
information correctly to the path. This was resulting in failures in many
regression test cases. Lack of distribution information, prevented the
distributed query planner from adding a Remote Subplan node on top of the plan,
thus resulting in local execution of the plan. Since the underlying table is
actually a distributed table, local execution fails to fetch any data.
Fix this by properly copying distribution info. Several regression failures are
fixed automatically with this patch.
-rw-r--r-- | src/backend/optimizer/util/pathnode.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 4c10883dc1..3724d10b4a 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -3936,6 +3936,9 @@ create_set_projection_path(PlannerInfo *root, /* Projection does not change the sort order XXX? */ pathnode->path.pathkeys = subpath->pathkeys; + /* distribution is the same as in the subpath */ + pathnode->path.distribution = copyObject(subpath->distribution); + pathnode->subpath = subpath; /* |