Simply create a copy of the subpath's distribution, just like in most
other paths.
/* Unique doesn't change the input ordering */
pathnode->path.pathkeys = subpath->pathkeys;
+ pathnode->path.distribution = (Distribution *) copyObject(subpath->distribution);
+
pathnode->subpath = subpath;
pathnode->numkeys = numCols;
pathnode->path.pathkeys =
(strategy == SETOP_SORTED) ? subpath->pathkeys : NIL;
+ pathnode->path.distribution = copyObject(subpath->distribution);
+
pathnode->subpath = subpath;
pathnode->cmd = cmd;
pathnode->strategy = strategy;