typedef struct RangeIOData
{
TypeCacheEntry *typcache; /* range type's typcache entry */
- Oid typiofunc; /* element type's I/O function */
+ FmgrInfo typioproc; /* element type's I/O function */
Oid typioparam; /* element type's I/O parameter */
- FmgrInfo proc; /* lookup result for typiofunc */
} RangeIOData;
/* call element type's input function */
if (RANGE_HAS_LBOUND(flags))
- lower.val = InputFunctionCall(&cache->proc, lbound_str,
+ lower.val = InputFunctionCall(&cache->typioproc, lbound_str,
cache->typioparam, typmod);
if (RANGE_HAS_UBOUND(flags))
- upper.val = InputFunctionCall(&cache->proc, ubound_str,
+ upper.val = InputFunctionCall(&cache->typioproc, ubound_str,
cache->typioparam, typmod);
lower.infinite = (flags & RANGE_LB_INF) != 0;
/* call element type's output function */
if (RANGE_HAS_LBOUND(flags))
- lbound_str = OutputFunctionCall(&cache->proc, lower.val);
+ lbound_str = OutputFunctionCall(&cache->typioproc, lower.val);
if (RANGE_HAS_UBOUND(flags))
- ubound_str = OutputFunctionCall(&cache->proc, upper.val);
+ ubound_str = OutputFunctionCall(&cache->typioproc, upper.val);
/* construct result string */
output_str = range_deparse(flags, lbound_str, ubound_str);
initStringInfo(&bound_buf);
appendBinaryStringInfo(&bound_buf, bound_data, bound_len);
- lower.val = ReceiveFunctionCall(&cache->proc,
+ lower.val = ReceiveFunctionCall(&cache->typioproc,
&bound_buf,
cache->typioparam,
typmod);
initStringInfo(&bound_buf);
appendBinaryStringInfo(&bound_buf, bound_data, bound_len);
- upper.val = ReceiveFunctionCall(&cache->proc,
+ upper.val = ReceiveFunctionCall(&cache->typioproc,
&bound_buf,
cache->typioparam,
typmod);
if (RANGE_HAS_LBOUND(flags))
{
- Datum bound = PointerGetDatum(SendFunctionCall(&cache->proc,
+ Datum bound = PointerGetDatum(SendFunctionCall(&cache->typioproc,
lower.val));
uint32 bound_len = VARSIZE(bound) - VARHDRSZ;
char *bound_data = VARDATA(bound);
if (RANGE_HAS_UBOUND(flags))
{
- Datum bound = PointerGetDatum(SendFunctionCall(&cache->proc,
+ Datum bound = PointerGetDatum(SendFunctionCall(&cache->typioproc,
upper.val));
uint32 bound_len = VARSIZE(bound) - VARHDRSZ;
char *bound_data = VARDATA(bound);
bool typbyval;
char typalign;
char typdelim;
+ Oid typiofunc;
cache = (RangeIOData *) MemoryContextAlloc(fcinfo->flinfo->fn_mcxt,
sizeof(RangeIOData));
&typalign,
&typdelim,
&cache->typioparam,
- &cache->typiofunc);
+ &typiofunc);
- if (!OidIsValid(cache->typiofunc))
+ if (!OidIsValid(typiofunc))
{
/* this could only happen for receive or send */
if (func == IOFunc_receive)
errmsg("no binary output function available for type %s",
format_type_be(cache->typcache->rngelemtype->type_id))));
}
- fmgr_info_cxt(cache->typiofunc, &cache->proc,
+ fmgr_info_cxt(typiofunc, &cache->typioproc,
fcinfo->flinfo->fn_mcxt);
fcinfo->flinfo->fn_extra = (void *) cache;