From 102c995d02651382da4e000ae24946e387b9be36 Mon Sep 17 00:00:00 2001 From: Tomas Vondra Date: Thu, 8 Jun 2017 17:18:01 +0200 Subject: [PATCH] Add remote subquery step to recurse_set_operations During the initial phase of resolving 9.6 merge conflicts in the planner we have switched back to a clean upstream code for some files (including prepunion.c). Then we reintroduced the XL-specific bits with necessary tweaks, caused particularly by upper-planner pathification. We have however forgot about this bit in recurse_set_operations, so this commit fixes that by adding the redistribution again. This fixes failures in collate, copyselect and union regression suites. Patch by senhu , review and commit by me. --- src/backend/optimizer/prep/prepunion.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/backend/optimizer/prep/prepunion.c b/src/backend/optimizer/prep/prepunion.c index 2522636392..a8163bfaff 100644 --- a/src/backend/optimizer/prep/prepunion.c +++ b/src/backend/optimizer/prep/prepunion.c @@ -313,6 +313,19 @@ recurse_set_operations(Node *setOp, PlannerInfo *root, subpath = get_cheapest_fractional_path(final_rel, root->tuple_fraction); +#ifdef XCP + /* + * create remote_subplan_path if needed, and we'll use this path to + * create remote_subplan at the top. + */ + if(subpath->distribution) + { + subpath = create_remotesubplan_path(NULL, subpath, NULL); + + subroot->distribution = NULL; + } +#endif + /* * Stick a SubqueryScanPath atop that. * -- 2.39.5