func_error() changed so that if caller is passed with NULL value, its

output at least doesn't appear that its missing something.

wasn't particularly confident with removing 'caller' altogether :(
This commit is contained in:
Marc G. Fournier 1998-02-05 04:08:44 +00:00
parent af7a2b3243
commit 7b6cbd53f7
2 changed files with 11 additions and 7 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.11 1998/02/05 03:35:48 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.12 1998/02/05 04:08:42 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -728,7 +728,7 @@ func_get_detail(char *funcname,
funcname);
elog(NOTICE, "that satisfies the given argument types. you will have to");
elog(NOTICE, "retype your query using explicit typecasts.");
func_error(funcname, nargs, oid_array);
func_error(NULL, funcname, nargs, oid_array);
}
else
{
@ -758,7 +758,7 @@ func_get_detail(char *funcname,
elog(ERROR, "no such attribute or function \"%s\"",
funcname);
}
func_error(funcname, nargs, oid_array);
func_error(NULL, funcname, nargs, oid_array);
}
else
{
@ -1276,7 +1276,7 @@ ParseComplexProjection(ParseState *pstate,
* argument types
*/
void
func_error(char *funcname, int nargs, Oid *argtypes)
func_error(char *caller, char *funcname, int nargs, Oid *argtypes)
{
char p[(NAMEDATALEN + 2) * MAXFMGRARGS],
*ptr;
@ -1301,5 +1301,9 @@ func_error(char *funcname, int nargs, Oid *argtypes)
ptr += strlen(ptr);
}
elog(ERROR, "function %s(%s) does not exist", funcname, p);
if(caller == NULL) {
elog(ERROR, "function %s(%s) does not exist", funcname, p);
} else {
elog(ERROR, "%s: function %s(%s) does not exist", caller, funcname, p);
}
}

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_func.h,v 1.6 1998/02/05 03:40:10 scrappy Exp $
* $Id: parse_func.h,v 1.7 1998/02/05 04:08:44 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -47,7 +47,7 @@ extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
extern Node *ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
int *curr_resno, int precedence);
extern void func_error(char *funcname, int nargs, Oid *argtypes);
extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
#endif /* PARSE_FUNC_H */