From: Tomas Vondra Date: Mon, 16 Jan 2017 00:09:22 +0000 (+0100) Subject: add T_GroupingFunc to pgxc_shippability_walker X-Git-Tag: XL_10_R1BETA1~455 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=6025f9ee6883c69c112c9a842140efc921e58c99;p=postgres-xl.git add T_GroupingFunc to pgxc_shippability_walker Planning grouping sets queries with grouping() function failed with ERROR: XX000: unrecognized node type: 307 LOCATION: pgxc_shippability_walker, pgxcship.c:1199 STATEMENT: select grouping(a, b), count(*) from t1 group by grouping sets ((a), (b)); We simply inspect arguments of the grouping() function, although that probably is not necessary - it can only reference grouping expressions, which are checked as part of other nodes. --- diff --git a/src/backend/optimizer/util/pgxcship.c b/src/backend/optimizer/util/pgxcship.c index a8f3d94d44..bcee7e8d00 100644 --- a/src/backend/optimizer/util/pgxcship.c +++ b/src/backend/optimizer/util/pgxcship.c @@ -1194,6 +1194,16 @@ pgxc_shippability_walker(Node *node, Shippability_context *sc_context) } break; + case T_GroupingFunc: + /* + * Let expression tree walker inspect the arguments. Not sure if + * that's necessary, as those are just references to grouping + * expressions of the query (and thus likely examined as part + * of another node). + */ + return expression_tree_walker(node, pgxc_shippability_walker, + sc_context); + default: elog(ERROR, "unrecognized node type: %d", (int) nodeTag(node));