summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-01-16 00:09:22 +0000
committerTomas Vondra2017-01-16 00:09:22 +0000
commit6025f9ee6883c69c112c9a842140efc921e58c99 (patch)
treeda65ea23b3730542ef8052673ad15e46ebda362f
parenta65a0617800218c247edd7183b1f058fa2fc4262 (diff)
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.
-rw-r--r--src/backend/optimizer/util/pgxcship.c10
1 files changed, 10 insertions, 0 deletions
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));