From 2aa6852dea9019e59cf258aa1946a476c5f9093d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Wed, 11 Sep 2019 21:42:25 +0000 Subject: [PATCH] Begin searching AggregateNames from 1, not 0 --- src/backend/distributed/planner/multi_logical_optimizer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/distributed/planner/multi_logical_optimizer.c b/src/backend/distributed/planner/multi_logical_optimizer.c index f93312779..52db3da29 100644 --- a/src/backend/distributed/planner/multi_logical_optimizer.c +++ b/src/backend/distributed/planner/multi_logical_optimizer.c @@ -2896,7 +2896,9 @@ GetAggregateType(Oid aggFunctionId) } aggregateCount = lengthof(AggregateNames); - for (aggregateIndex = 0; aggregateIndex < aggregateCount; aggregateIndex++) + + Assert(AGGREGATE_INVALID_FIRST == 0); + for (aggregateIndex = 1; aggregateIndex < aggregateCount; aggregateIndex++) { const char *aggregateName = AggregateNames[aggregateIndex]; if (strncmp(aggregateName, aggregateProcName, NAMEDATALEN) == 0)