MCPcopy Create free account
hub / github.com/apache/cloudberry / ReceiveFunctionCall

Function ReceiveFunctionCall

src/backend/utils/fmgr/fmgr.c:1588–1624  ·  view source on GitHub ↗

* Call a previously-looked-up datatype binary-input function. * * "buf" may be NULL to indicate we are reading a NULL. In this case * the caller should assume the result is NULL, but we'll call the receive * function anyway if it's not strict. So this is almost but not quite * the same as FunctionCall3. */

Source from the content-addressed store, hash-verified

1586 * the same as FunctionCall3.
1587 */
1588Datum
1589ReceiveFunctionCall(FmgrInfo *flinfo, StringInfo buf,
1590 Oid typioparam, int32 typmod)
1591{
1592 LOCAL_FCINFO(fcinfo, 3);
1593 Datum result;
1594
1595 if (buf == NULL && flinfo->fn_strict)
1596 return (Datum) 0; /* just return null result */
1597
1598 InitFunctionCallInfoData(*fcinfo, flinfo, 3, InvalidOid, NULL, NULL);
1599
1600 fcinfo->args[0].value = PointerGetDatum(buf);
1601 fcinfo->args[0].isnull = false;
1602 fcinfo->args[1].value = ObjectIdGetDatum(typioparam);
1603 fcinfo->args[1].isnull = false;
1604 fcinfo->args[2].value = Int32GetDatum(typmod);
1605 fcinfo->args[2].isnull = false;
1606
1607 result = FunctionCallInvoke(fcinfo);
1608
1609 /* Should get null result if and only if buf is NULL */
1610 if (buf == NULL)
1611 {
1612 if (!fcinfo->isnull)
1613 elog(ERROR, "receive function %u returned non-NULL",
1614 flinfo->fn_oid);
1615 }
1616 else
1617 {
1618 if (fcinfo->isnull)
1619 elog(ERROR, "receive function %u returned NULL",
1620 flinfo->fn_oid);
1621 }
1622
1623 return result;
1624}
1625
1626/*
1627 * Call a previously-looked-up datatype binary-output function.

Callers 8

multirange_recvFunction · 0.85
domain_recvFunction · 0.85
range_recvFunction · 0.85
ReadArrayBinaryFunction · 0.85
array_agg_deserializeFunction · 0.85
record_recvFunction · 0.85
OidReceiveFunctionCallFunction · 0.85
CopyReadBinaryAttributeFunction · 0.85

Calls 2

ObjectIdGetDatumFunction · 0.85
Int32GetDatumFunction · 0.85

Tested by

no test coverage detected