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

Function postquel_sub_params

src/backend/executor/functions.c:1072–1105  ·  view source on GitHub ↗

Build ParamListInfo array representing current arguments */

Source from the content-addressed store, hash-verified

1070
1071/* Build ParamListInfo array representing current arguments */
1072static void
1073postquel_sub_params(SQLFunctionCachePtr fcache,
1074 FunctionCallInfo fcinfo)
1075{
1076 int nargs = fcinfo->nargs;
1077
1078 if (nargs > 0)
1079 {
1080 ParamListInfo paramLI;
1081
1082 if (fcache->paramLI == NULL)
1083 {
1084 paramLI = makeParamList(nargs);
1085 fcache->paramLI = paramLI;
1086 }
1087 else
1088 {
1089 paramLI = fcache->paramLI;
1090 Assert(paramLI->numParams == nargs);
1091 }
1092
1093 for (int i = 0; i < nargs; i++)
1094 {
1095 ParamExternData *prm = &paramLI->params[i];
1096
1097 prm->value = fcinfo->args[i].value;
1098 prm->isnull = fcinfo->args[i].isnull;
1099 prm->pflags = 0;
1100 prm->ptype = fcache->pinfo->argtypes[i];
1101 }
1102 }
1103 else
1104 fcache->paramLI = NULL;
1105}
1106
1107/*
1108 * Extract the SQL function's value from a single result row. This is used

Callers 1

fmgr_sqlFunction · 0.85

Calls 1

makeParamListFunction · 0.85

Tested by

no test coverage detected