PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ PGISDirectFunctionCall1()

Datum PGISDirectFunctionCall1 ( PGFunction  func,
Datum  arg1 
)

A modified version of PostgreSQL's DirectFunctionCall1 which allows NULL results; this is required for aggregates that return NULL.

Definition at line 386 of file lwgeom_accum.c.

387 {
388 #if POSTGIS_PGSQL_VERSION < 120
389  FunctionCallInfoData fcinfo;
390  Datum result;
391 
392 
393  InitFunctionCallInfoData(fcinfo, NULL, 1, InvalidOid, NULL, NULL);
394 
395 
396  fcinfo.arg[0] = arg1;
397  fcinfo.argnull[0] = false;
398 
399  result = (*func) (&fcinfo);
400 
401  /* Check for null result, returning a "NULL" Datum if indicated */
402  if (fcinfo.isnull)
403  return (Datum) 0;
404 
405  return result;
406 #else
407  LOCAL_FCINFO(fcinfo, 1);
408  Datum result;
409 
410  InitFunctionCallInfoData(*fcinfo, NULL, 1, InvalidOid, NULL, NULL);
411 
412  fcinfo->args[0].value = arg1;
413  fcinfo->args[0].isnull = false;
414 
415  result = (*func)(fcinfo);
416 
417  /* Check for null result, returning a "NULL" Datum if indicated */
418  if (fcinfo->isnull)
419  return (Datum)0;
420 
421  return result;
422 #endif /* POSTGIS_PGSQL_VERSION < 120 */
423 }

Referenced by pgis_geometry_clusterintersecting_finalfn(), pgis_geometry_collect_finalfn(), pgis_geometry_makeline_finalfn(), pgis_geometry_polygonize_finalfn(), and pgis_geometry_union_finalfn().

Here is the caller graph for this function: