Commit 18bdefa2 authored by Thomas G. Lockhart's avatar Thomas G. Lockhart

Fix reference to null pointer when no aggregate function candidates

 are available. Problem reported by David Sauer <davids@iol.cz>.
Modify information in resulting error message to indicate both agg name
 and data type.
parent 5afe8d34
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.35 1998/12/15 12:46:14 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.36 1998/12/23 14:38:40 thomas Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -225,7 +225,7 @@ agg_select_candidate(Oid typeid, CandidateList candidates) ...@@ -225,7 +225,7 @@ agg_select_candidate(Oid typeid, CandidateList candidates)
} }
} }
/* otherwise, don't bother keeping this one around... */ /* otherwise, don't bother keeping this one around... */
else else if (last_candidate != NULL)
{ {
last_candidate->next = NULL; last_candidate->next = NULL;
} }
...@@ -399,8 +399,8 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs, ...@@ -399,8 +399,8 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
} }
else else
{ {
elog(ERROR,"Unable to select an aggregate function for type '%s'", elog(ERROR,"Unable to select an aggregate function %s(%s)",
typeidTypeName(basetype)); funcname, typeidTypeName(basetype));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment