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

Function format_function_arguments_old

src/bin/pg_dump/pg_dump.c:13152–13216  ·  view source on GitHub ↗

* format_function_arguments_old: generate function name and argument list * * The argument type names are qualified if needed. The function name * is never qualified. * * This is used only with pre-GPDB 5.0 servers, so we aren't expecting to see * DEFAULT arguments. * * Any or all of allargtypes, argmodes, argnames may be NULL. */

Source from the content-addressed store, hash-verified

13150 * Any or all of allargtypes, argmodes, argnames may be NULL.
13151 */
13152static char *
13153format_function_arguments_old(Archive *fout,
13154 const FuncInfo *finfo, int nallargs,
13155 char **allargtypes,
13156 char **argmodes,
13157 char **argnames)
13158{
13159 PQExpBufferData fn;
13160 int j;
13161
13162 initPQExpBuffer(&fn);
13163 appendPQExpBuffer(&fn, "%s(", fmtId(finfo->dobj.name));
13164 for (j = 0; j < nallargs; j++)
13165 {
13166 Oid typid;
13167 const char *typname;
13168 const char *argmode;
13169 const char *argname;
13170
13171 typid = allargtypes ? atooid(allargtypes[j]) : finfo->argtypes[j];
13172 typname = getFormattedTypeName(fout, typid, zeroIsError);
13173
13174 if (argmodes)
13175 {
13176 switch (argmodes[j][0])
13177 {
13178 case PROARGMODE_IN:
13179 argmode = "";
13180 break;
13181 case PROARGMODE_OUT:
13182 argmode = "OUT ";
13183 break;
13184 case PROARGMODE_INOUT:
13185 argmode = "INOUT ";
13186 break;
13187 case PROARGMODE_VARIADIC:
13188 argmode = "VARIADIC ";
13189 break;
13190 case PROARGMODE_TABLE:
13191 /* skip table column's names */
13192 free((void *)typname);
13193 continue;
13194 default:
13195 pg_log_warning("bogus value in proargmodes array");
13196 argmode = "";
13197 break;
13198 }
13199 }
13200 else
13201 argmode = "";
13202
13203 argname = argnames ? argnames[j] : (char *) NULL;
13204 if (argname && argname[0] == '\0')
13205 argname = NULL;
13206
13207 appendPQExpBuffer(&fn, "%s%s%s%s%s",
13208 (j > 0) ? ", " : "",
13209 argmode,

Callers 1

dumpFuncFunction · 0.85

Calls 5

initPQExpBufferFunction · 0.85
appendPQExpBufferFunction · 0.85
fmtIdFunction · 0.85
getFormattedTypeNameFunction · 0.85
appendPQExpBufferCharFunction · 0.85

Tested by

no test coverage detected