Skip to content

Commit 7b6cbd5

Browse files
committed
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 :(
1 parent af7a2b3 commit 7b6cbd5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/backend/parser/parse_func.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.11 1998/02/05 03:35:48 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.12 1998/02/05 04:08:42 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -728,7 +728,7 @@ func_get_detail(char *funcname,
728728
funcname);
729729
elog(NOTICE, "that satisfies the given argument types. you will have to");
730730
elog(NOTICE, "retype your query using explicit typecasts.");
731-
func_error(funcname, nargs, oid_array);
731+
func_error(NULL, funcname, nargs, oid_array);
732732
}
733733
else
734734
{
@@ -758,7 +758,7 @@ func_get_detail(char *funcname,
758758
elog(ERROR, "no such attribute or function \"%s\"",
759759
funcname);
760760
}
761-
func_error(funcname, nargs, oid_array);
761+
func_error(NULL, funcname, nargs, oid_array);
762762
}
763763
else
764764
{
@@ -1276,7 +1276,7 @@ ParseComplexProjection(ParseState *pstate,
12761276
* argument types
12771277
*/
12781278
void
1279-
func_error(char *funcname, int nargs, Oid *argtypes)
1279+
func_error(char *caller, char *funcname, int nargs, Oid *argtypes)
12801280
{
12811281
char p[(NAMEDATALEN + 2) * MAXFMGRARGS],
12821282
*ptr;
@@ -1301,5 +1301,9 @@ func_error(char *funcname, int nargs, Oid *argtypes)
13011301
ptr += strlen(ptr);
13021302
}
13031303

1304-
elog(ERROR, "function %s(%s) does not exist", funcname, p);
1304+
if(caller == NULL) {
1305+
elog(ERROR, "function %s(%s) does not exist", funcname, p);
1306+
} else {
1307+
elog(ERROR, "%s: function %s(%s) does not exist", caller, funcname, p);
1308+
}
13051309
}

src/include/parser/parse_func.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: parse_func.h,v 1.6 1998/02/05 03:40:10 scrappy Exp $
9+
* $Id: parse_func.h,v 1.7 1998/02/05 04:08:44 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -47,7 +47,7 @@ extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
4747
extern Node *ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
4848
int *curr_resno, int precedence);
4949

50-
extern void func_error(char *funcname, int nargs, Oid *argtypes);
50+
extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
5151

5252
#endif /* PARSE_FUNC_H */
5353

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy