Skip to content

Commit 29f8f54

Browse files
committed
Fix compiler warning in multirange_constructor0()
Discussion: https://postgr.es/m/X%2BBP8XE0UpIB6Yvh%40paquier.xyz Author: Michael Paquier
1 parent 93e8ff8 commit 29f8f54

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/utils/adt/multirangetypes.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,20 +1016,20 @@ multirange_constructor1(PG_FUNCTION_ARGS)
10161016
Datum
10171017
multirange_constructor0(PG_FUNCTION_ARGS)
10181018
{
1019-
Oid mltrngtypid = get_fn_expr_rettype(fcinfo->flinfo);
1019+
Oid mltrngtypid;
10201020
TypeCacheEntry *typcache;
10211021
TypeCacheEntry *rangetyp;
10221022

1023+
/* This should always be called without arguments */
1024+
if (PG_NARGS() != 0)
1025+
elog(ERROR,
1026+
"niladic multirange constructor must not receive arguments");
1027+
1028+
mltrngtypid = get_fn_expr_rettype(fcinfo->flinfo);
10231029
typcache = multirange_get_typcache(fcinfo, mltrngtypid);
10241030
rangetyp = typcache->rngtype;
10251031

1026-
/* We should always be called with no arguments */
1027-
1028-
if (PG_NARGS() == 0)
1029-
PG_RETURN_MULTIRANGE_P(make_multirange(mltrngtypid, rangetyp, 0, NULL));
1030-
else
1031-
elog(ERROR, /* can't happen */
1032-
"niladic multirange constructor must not receive arguments");
1032+
PG_RETURN_MULTIRANGE_P(make_multirange(mltrngtypid, rangetyp, 0, NULL));
10331033
}
10341034

10351035

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy