From 72f7fd15a2a6b2aa11ca30792799de40631eac5f Mon Sep 17 00:00:00 2001 From: "Thomas G. Lockhart" Date: Wed, 23 Dec 1998 14:38:40 +0000 Subject: [PATCH] Fix reference to null pointer when no aggregate function candidates are available. Problem reported by David Sauer . Modify information in resulting error message to indicate both agg name and data type. --- src/backend/parser/parse_func.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index 277e676c3a..d2f86b33fd 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -225,7 +225,7 @@ agg_select_candidate(Oid typeid, CandidateList candidates) } } /* otherwise, don't bother keeping this one around... */ - else + else if (last_candidate != NULL) { last_candidate->next = NULL; } @@ -399,8 +399,8 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, } else { - elog(ERROR,"Unable to select an aggregate function for type '%s'", - typeidTypeName(basetype)); + elog(ERROR,"Unable to select an aggregate function %s(%s)", + funcname, typeidTypeName(basetype)); } } -- 2.39.5