Skip to content

Commit

Permalink
A
Browse files Browse the repository at this point in the history
  • Loading branch information
robozmey committed Dec 11, 2024
1 parent 80dd54f commit cfcc00d
Showing 1 changed file with 0 additions and 46 deletions.
46 changes: 0 additions & 46 deletions src/backend/utils/fmgr/fmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,52 +1998,6 @@ InputFunctionCall(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod)
return result;
}

Datum
InputFunctionCallSafe(FmgrInfo *flinfo, char *str, Oid typioparam, int32 typmod, fmNodePtr escontext)
{
FunctionCallInfoData fcinfo;
Datum result;
bool pushed;

if (str == NULL && flinfo->fn_strict)
return (Datum) 0; /* just return null result */

pushed = SPI_push_conditional();

InitFunctionCallInfoData(fcinfo, flinfo, 3, InvalidOid, escontext, NULL);

fcinfo.arg[0] = CStringGetDatum(str);
fcinfo.arg[1] = ObjectIdGetDatum(typioparam);
fcinfo.arg[2] = Int32GetDatum(typmod);
fcinfo.argnull[0] = (str == NULL);
fcinfo.argnull[1] = false;
fcinfo.argnull[2] = false;

result = FunctionCallInvoke(&fcinfo);

/* Result value is garbage, and could be null, if an error was reported */
if (SOFT_ERROR_OCCURRED(escontext))
return (Datum) 0;

/* Should get null result if and only if str is NULL */
if (str == NULL)
{
if (!fcinfo.isnull)
elog(ERROR, "input function %u returned non-NULL",
fcinfo.flinfo->fn_oid);
}
else
{
if (fcinfo.isnull)
elog(ERROR, "input function %u returned NULL",
fcinfo.flinfo->fn_oid);
}

SPI_pop_conditional(pushed);

return result;
}

/*
* Call a previously-looked-up datatype input function, with non-exception
* handling of "soft" errors.
Expand Down

0 comments on commit cfcc00d

Please sign in to comment.