mirror of
https://github.com/postgres/postgres.git
synced 2025-09-11 00:12:06 +03:00
pgindent run for 9.0
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.221 2010/02/14 18:42:15 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.222 2010/02/26 02:00:52 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -125,13 +125,13 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
*
|
||||
* We allow mixed notation (some named and some not), but only with all
|
||||
* the named parameters after all the unnamed ones. So the name list
|
||||
* corresponds to the last N actual parameters and we don't need any
|
||||
* extra bookkeeping to match things up.
|
||||
* corresponds to the last N actual parameters and we don't need any extra
|
||||
* bookkeeping to match things up.
|
||||
*/
|
||||
argnames = NIL;
|
||||
foreach(l, fargs)
|
||||
{
|
||||
Node *arg = lfirst(l);
|
||||
Node *arg = lfirst(l);
|
||||
|
||||
if (IsA(arg, NamedArgExpr))
|
||||
{
|
||||
@@ -144,8 +144,8 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
if (strcmp(na->name, (char *) lfirst(lc)) == 0)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("argument name \"%s\" used more than once",
|
||||
na->name),
|
||||
errmsg("argument name \"%s\" used more than once",
|
||||
na->name),
|
||||
parser_errposition(pstate, na->location)));
|
||||
}
|
||||
argnames = lappend(argnames, na->name);
|
||||
@@ -155,7 +155,7 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
if (argnames != NIL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_SYNTAX_ERROR),
|
||||
errmsg("positional argument cannot follow named argument"),
|
||||
errmsg("positional argument cannot follow named argument"),
|
||||
parser_errposition(pstate, exprLocation(arg))));
|
||||
}
|
||||
}
|
||||
@@ -246,8 +246,8 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
if (agg_order != NIL)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
|
||||
errmsg("ORDER BY specified, but %s is not an aggregate function",
|
||||
NameListToString(funcname)),
|
||||
errmsg("ORDER BY specified, but %s is not an aggregate function",
|
||||
NameListToString(funcname)),
|
||||
parser_errposition(pstate, location)));
|
||||
if (over)
|
||||
ereport(ERROR,
|
||||
@@ -262,8 +262,8 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
/*
|
||||
* Oops. Time to die.
|
||||
*
|
||||
* If we are dealing with the attribute notation rel.function,
|
||||
* let the caller handle failure.
|
||||
* If we are dealing with the attribute notation rel.function, let the
|
||||
* caller handle failure.
|
||||
*/
|
||||
if (is_column)
|
||||
return NULL;
|
||||
@@ -408,9 +408,9 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
|
||||
/*
|
||||
* Currently it's not possible to define an aggregate with named
|
||||
* arguments, so this case should be impossible. Check anyway
|
||||
* because the planner and executor wouldn't cope with NamedArgExprs
|
||||
* in an Aggref node.
|
||||
* arguments, so this case should be impossible. Check anyway because
|
||||
* the planner and executor wouldn't cope with NamedArgExprs in an
|
||||
* Aggref node.
|
||||
*/
|
||||
if (argnames != NIL)
|
||||
ereport(ERROR,
|
||||
@@ -481,9 +481,9 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs,
|
||||
parser_errposition(pstate, location)));
|
||||
|
||||
/*
|
||||
* We might want to support this later, but for now reject it
|
||||
* because the planner and executor wouldn't cope with NamedArgExprs
|
||||
* in a WindowFunc node.
|
||||
* We might want to support this later, but for now reject it because
|
||||
* the planner and executor wouldn't cope with NamedArgExprs in a
|
||||
* WindowFunc node.
|
||||
*/
|
||||
if (argnames != NIL)
|
||||
ereport(ERROR,
|
||||
@@ -1075,10 +1075,9 @@ func_get_detail(List *funcname,
|
||||
return FUNCDETAIL_MULTIPLE;
|
||||
|
||||
/*
|
||||
* We disallow VARIADIC with named arguments unless the last
|
||||
* argument (the one with VARIADIC attached) actually matched the
|
||||
* variadic parameter. This is mere pedantry, really, but some
|
||||
* folks insisted.
|
||||
* We disallow VARIADIC with named arguments unless the last argument
|
||||
* (the one with VARIADIC attached) actually matched the variadic
|
||||
* parameter. This is mere pedantry, really, but some folks insisted.
|
||||
*/
|
||||
if (fargnames != NIL && !expand_variadic && nargs > 0 &&
|
||||
best_candidate->argnumbers[nargs - 1] != nargs - 1)
|
||||
@@ -1142,17 +1141,17 @@ func_get_detail(List *funcname,
|
||||
{
|
||||
/*
|
||||
* This is a bit tricky in named notation, since the supplied
|
||||
* arguments could replace any subset of the defaults. We
|
||||
* arguments could replace any subset of the defaults. We
|
||||
* work by making a bitmapset of the argnumbers of defaulted
|
||||
* arguments, then scanning the defaults list and selecting
|
||||
* the needed items. (This assumes that defaulted arguments
|
||||
* should be supplied in their positional order.)
|
||||
*/
|
||||
Bitmapset *defargnumbers;
|
||||
int *firstdefarg;
|
||||
List *newdefaults;
|
||||
ListCell *lc;
|
||||
int i;
|
||||
Bitmapset *defargnumbers;
|
||||
int *firstdefarg;
|
||||
List *newdefaults;
|
||||
ListCell *lc;
|
||||
int i;
|
||||
|
||||
defargnumbers = NULL;
|
||||
firstdefarg = &best_candidate->argnumbers[best_candidate->nargs - best_candidate->ndargs];
|
||||
@@ -1174,8 +1173,8 @@ func_get_detail(List *funcname,
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Defaults for positional notation are lots easier;
|
||||
* just remove any unwanted ones from the front.
|
||||
* Defaults for positional notation are lots easier; just
|
||||
* remove any unwanted ones from the front.
|
||||
*/
|
||||
int ndelete;
|
||||
|
||||
@@ -1226,11 +1225,11 @@ make_fn_arguments(ParseState *pstate,
|
||||
/* types don't match? then force coercion using a function call... */
|
||||
if (actual_arg_types[i] != declared_arg_types[i])
|
||||
{
|
||||
Node *node = (Node *) lfirst(current_fargs);
|
||||
Node *node = (Node *) lfirst(current_fargs);
|
||||
|
||||
/*
|
||||
* If arg is a NamedArgExpr, coerce its input expr instead ---
|
||||
* we want the NamedArgExpr to stay at the top level of the list.
|
||||
* If arg is a NamedArgExpr, coerce its input expr instead --- we
|
||||
* want the NamedArgExpr to stay at the top level of the list.
|
||||
*/
|
||||
if (IsA(node, NamedArgExpr))
|
||||
{
|
||||
@@ -1364,7 +1363,7 @@ ParseComplexProjection(ParseState *pstate, char *funcname, Node *first_arg,
|
||||
* The result is something like "foo(integer)".
|
||||
*
|
||||
* If argnames isn't NIL, it is a list of C strings representing the actual
|
||||
* arg names for the last N arguments. This must be considered part of the
|
||||
* arg names for the last N arguments. This must be considered part of the
|
||||
* function signature too, when dealing with named-notation function calls.
|
||||
*
|
||||
* This is typically used in the construction of function-not-found error
|
||||
|
Reference in New Issue
Block a user