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

Function process_query_params

contrib/postgres_fdw/postgres_fdw.c:4895–4930  ·  view source on GitHub ↗

* Construct array of query parameter values in text format. */

Source from the content-addressed store, hash-verified

4893 * Construct array of query parameter values in text format.
4894 */
4895static void
4896process_query_params(ExprContext *econtext,
4897 FmgrInfo *param_flinfo,
4898 List *param_exprs,
4899 const char **param_values)
4900{
4901 int nestlevel;
4902 int i;
4903 ListCell *lc;
4904
4905 nestlevel = set_transmission_modes();
4906
4907 i = 0;
4908 foreach(lc, param_exprs)
4909 {
4910 ExprState *expr_state = (ExprState *) lfirst(lc);
4911 Datum expr_value;
4912 bool isNull;
4913
4914 /* Evaluate the parameter expression */
4915 expr_value = ExecEvalExpr(expr_state, econtext, &isNull);
4916
4917 /*
4918 * Get string representation of each parameter value by invoking
4919 * type-specific output function, unless the value is null.
4920 */
4921 if (isNull)
4922 param_values[i] = NULL;
4923 else
4924 param_values[i] = OutputFunctionCall(&param_flinfo[i], expr_value);
4925
4926 i++;
4927 }
4928
4929 reset_transmission_modes(nestlevel);
4930}
4931
4932/*
4933 * postgresAnalyzeForeignTable

Callers 2

create_cursorFunction · 0.85
execute_dml_stmtFunction · 0.85

Calls 5

set_transmission_modesFunction · 0.85
ExecEvalExprFunction · 0.85
OutputFunctionCallFunction · 0.85
reset_transmission_modesFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected