1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +03:00

Replace LookupFuncNameTypeNames() with LookupFuncWithArgs()

The old function took function name and function argument list as
separate arguments.  Now that all function signatures are passed around
as ObjectWithArgs structs, this is no longer necessary and can be
replaced by a function that takes ObjectWithArgs directly.  Similarly
for aggregates and operators.

Reviewed-by: Jim Nasby <Jim.Nasby@BlueTreble.com>
Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
Peter Eisentraut
2016-12-28 12:00:00 -05:00
parent 8b6d6cf853
commit 2ca64c6f71
13 changed files with 68 additions and 116 deletions

View File

@ -132,32 +132,34 @@ LookupOperName(ParseState *pstate, List *opername, Oid oprleft, Oid oprright,
}
/*
* LookupOperNameTypeNames
* LookupOperWithArgs
* Like LookupOperName, but the argument types are specified by
* TypeName nodes.
*
* Pass oprleft = NULL for a prefix op, oprright = NULL for a postfix op.
* a ObjectWithArg node.
*/
Oid
LookupOperNameTypeNames(ParseState *pstate, List *opername,
TypeName *oprleft, TypeName *oprright,
bool noError, int location)
LookupOperWithArgs(ObjectWithArgs *oper, bool noError)
{
TypeName *oprleft,
*oprright;
Oid leftoid,
rightoid;
Assert(list_length(oper->objargs) == 2);
oprleft = linitial(oper->objargs);
oprright = lsecond(oper->objargs);
if (oprleft == NULL)
leftoid = InvalidOid;
else
leftoid = LookupTypeNameOid(pstate, oprleft, noError);
leftoid = LookupTypeNameOid(NULL, oprleft, noError);
if (oprright == NULL)
rightoid = InvalidOid;
else
rightoid = LookupTypeNameOid(pstate, oprright, noError);
rightoid = LookupTypeNameOid(NULL, oprright, noError);
return LookupOperName(pstate, opername, leftoid, rightoid,
noError, location);
return LookupOperName(NULL, oper->objname, leftoid, rightoid,
noError, -1);
}
/*