Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7b6cbd5

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 parentaf7a2b3 commit7b6cbd5

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/0503:35:48 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.12 1998/02/0504: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,intnargs,Oid*argtypes)
1279+
func_error(char*caller,char*funcname,intnargs,Oid*argtypes)
12801280
{
12811281
charp[(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/0503:40:10 scrappy Exp $
9+
* $Id: parse_func.h,v 1.7 1998/02/0504:08:44 scrappy Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -47,7 +47,7 @@ extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
4747
externNode*ParseFuncOrColumn(ParseState*pstate,char*funcname,List*fargs,
4848
int*curr_resno,intprecedence);
4949

50-
externvoidfunc_error(char*funcname,intnargs,Oid*argtypes);
50+
externvoidfunc_error(char*caller,char*funcname,intnargs,Oid*argtypes);
5151

5252
#endif/* PARSE_FUNC_H */
5353

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp