From: Tomas Vondra Date: Sun, 28 Aug 2016 02:48:11 +0000 (+0200) Subject: add an assert to create_remotequery_path for RELOPT_BASEREL case X-Git-Tag: XL9_5_R1_4~21 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=85579d6df15e62d5284797867de785ee30bae64b;p=postgres-xl.git add an assert to create_remotequery_path for RELOPT_BASEREL case Make sure that for base relations, both the paths (left and right) and join restrictlist are NULL (or NIL for the list). I'm not sure if this is true for RELOPT_OTHER_MEMBER_REL also, so only do this for RELOPT_BASEREL. Perhaps we should also convert the inverse condition (for join relations) to an assert - currently it's an if condition: if (rel->reloptkind == RELOPT_JOINREL && (!leftpath || !rightpath)) ... but I've left that alone for now. --- diff --git a/src/backend/optimizer/path/pgxcpath.c b/src/backend/optimizer/path/pgxcpath.c index 0d2385c43b..832aee965c 100644 --- a/src/backend/optimizer/path/pgxcpath.c +++ b/src/backend/optimizer/path/pgxcpath.c @@ -69,6 +69,17 @@ create_remotequery_path(PlannerInfo *root, RelOptInfo *rel, ExecNodes *exec_node switch (rel->reloptkind) { case RELOPT_BASEREL: + + /* + * For baserels, the left/right path and restrictlist should be NULL. + * + * XXX I'm not sure if the same is true for other non-join rels, so + * let's only add it for the RELOPT_BASEREL case. + */ + Assert(leftpath == NULL && rightpath == NULL && join_restrictlist == NIL); + + /* fall-through */ + case RELOPT_OTHER_MEMBER_REL: { RangeTblEntry *rte = rt_fetch(rel->relid, root->parse->rtable);