mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Fix crash when using CALL on an aggregate
Author: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com> Reported-by: Rushabh Lathia <rushabh.lathia@gmail.com>
This commit is contained in:
@ -336,6 +336,15 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
Form_pg_aggregate classForm;
|
||||
int catDirectArgs;
|
||||
|
||||
if (proc_call)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
||||
errmsg("%s is not a procedure",
|
||||
func_signature_string(funcname, nargs,
|
||||
argnames,
|
||||
actual_arg_types)),
|
||||
parser_errposition(pstate, location)));
|
||||
|
||||
tup = SearchSysCache1(AGGFNOID, ObjectIdGetDatum(funcid));
|
||||
if (!HeapTupleIsValid(tup)) /* should not happen */
|
||||
elog(ERROR, "cache lookup failed for aggregate %u", funcid);
|
||||
|
Reference in New Issue
Block a user