Fix compiler warning in multirange_constructor0()
Discussion: https://postgr.es/m/X%2BBP8XE0UpIB6Yvh%40paquier.xyz Author: Michael Paquier
This commit is contained in:
parent
93e8ff8701
commit
29f8f54676
@ -1016,20 +1016,20 @@ multirange_constructor1(PG_FUNCTION_ARGS)
|
|||||||
Datum
|
Datum
|
||||||
multirange_constructor0(PG_FUNCTION_ARGS)
|
multirange_constructor0(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
Oid mltrngtypid = get_fn_expr_rettype(fcinfo->flinfo);
|
Oid mltrngtypid;
|
||||||
TypeCacheEntry *typcache;
|
TypeCacheEntry *typcache;
|
||||||
TypeCacheEntry *rangetyp;
|
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);
|
typcache = multirange_get_typcache(fcinfo, mltrngtypid);
|
||||||
rangetyp = typcache->rngtype;
|
rangetyp = typcache->rngtype;
|
||||||
|
|
||||||
/* We should always be called with no arguments */
|
PG_RETURN_MULTIRANGE_P(make_multirange(mltrngtypid, rangetyp, 0, NULL));
|
||||||
|
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user