From: Tomas Vondra Date: Sun, 15 Jan 2017 03:53:51 +0000 (+0100) Subject: set pathtarget and parallel_aware/safe flags in redistribute_path X-Git-Tag: XL_10_R1BETA1~457 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ba7b4ef331dd15a80f598145fd875604d648e006;p=postgres-xl.git set pathtarget and parallel_aware/safe flags in redistribute_path This fixes segfault in 'boolean' regression test suite. --- diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 3bab1ed9f2..a63afa139e 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -1290,11 +1290,18 @@ redistribute_path(Path *subpath, char distributionType, pathnode = makeNode(RemoteSubPath); pathnode->path.pathtype = T_RemoteSubplan; pathnode->path.parent = rel; + pathnode->path.pathtarget = rel->reltarget; pathnode->path.param_info = subpath->param_info; pathnode->path.pathkeys = subpath->pathkeys; pathnode->subpath = mpath->subpath; + + /* We don't want to run subplains in parallel workers */ + pathnode->path.parallel_aware = false; + pathnode->path.parallel_safe = false; + mpath->subpath = (Path *) pathnode; } + subpath = pathnode->subpath; pathnode->path.distribution = distribution; mpath->path.distribution = (Distribution *) copyObject(distribution); @@ -1316,10 +1323,16 @@ redistribute_path(Path *subpath, char distributionType, pathnode = makeNode(RemoteSubPath); pathnode->path.pathtype = T_RemoteSubplan; pathnode->path.parent = rel; + pathnode->path.pathtarget = rel->reltarget; pathnode->path.param_info = subpath->param_info; pathnode->path.pathkeys = subpath->pathkeys; pathnode->subpath = subpath; pathnode->path.distribution = distribution; + + /* We don't want to run subplains in parallel workers */ + pathnode->path.parallel_aware = false; + pathnode->path.parallel_safe = false; + cost_remote_subplan((Path *) pathnode, subpath->startup_cost, subpath->total_cost, subpath->rows, rel->reltarget->width, IsLocatorReplicated(distributionType) ?