Fix compiler warning in multirange_constructor0()

Discussion: https://postgr.es/m/X%2BBP8XE0UpIB6Yvh%40paquier.xyz
Author: Michael Paquier
This commit is contained in:
Alexander Korotkov 2020-12-21 14:25:32 +03:00
parent 93e8ff8701
commit 29f8f54676

View File

@ -1016,20 +1016,20 @@ multirange_constructor1(PG_FUNCTION_ARGS)
Datum
multirange_constructor0(PG_FUNCTION_ARGS)
{
Oid mltrngtypid = get_fn_expr_rettype(fcinfo->flinfo);
Oid mltrngtypid;
TypeCacheEntry *typcache;
TypeCacheEntry *rangetyp;
/* This should always be called without arguments */
if (PG_NARGS() != 0)
elog(ERROR,
"niladic multirange constructor must not receive arguments");
mltrngtypid = get_fn_expr_rettype(fcinfo->flinfo);
typcache = multirange_get_typcache(fcinfo, mltrngtypid);
rangetyp = typcache->rngtype;
/* We should always be called with no arguments */
if (PG_NARGS() == 0)
PG_RETURN_MULTIRANGE_P(make_multirange(mltrngtypid, rangetyp, 0, NULL));
else
elog(ERROR, /* can't happen */
"niladic multirange constructor must not receive arguments");
PG_RETURN_MULTIRANGE_P(make_multirange(mltrngtypid, rangetyp, 0, NULL));
}