Content-Length: 294128 | pFad | http://github.com/postgrespro/postgres/commit/29f8f546767ebb4253f6dc37815e2d95fff9acd0

36 Fix compiler warning in multirange_constructor0() · postgrespro/postgres@29f8f54 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/29f8f546767ebb4253f6dc37815e2d95fff9acd0

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy