PostgreSQL Source Code  git master
parse_param.h File Reference
Include dependency graph for parse_param.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void setup_parse_fixed_parameters (ParseState *pstate, const Oid *paramTypes, int numParams)
 
void setup_parse_variable_parameters (ParseState *pstate, Oid **paramTypes, int *numParams)
 
void check_variable_parameters (ParseState *pstate, Query *query)
 
bool query_contains_extern_params (Query *query)
 

Function Documentation

◆ check_variable_parameters()

void check_variable_parameters ( ParseState pstate,
Query query 
)

Definition at line 268 of file parse_param.c.

269 {
270  VarParamState *parstate = (VarParamState *) pstate->p_ref_hook_state;
271 
272  /* If numParams is zero then no Params were generated, so no work */
273  if (*parstate->numParams > 0)
274  (void) query_tree_walker(query,
276  (void *) pstate, 0);
277 }
if(TABLE==NULL||TABLE_index==NULL)
Definition: isn.c:77
#define query_tree_walker(q, w, c, f)
Definition: nodeFuncs.h:156
static bool check_parameter_resolution_walker(Node *node, ParseState *pstate)
Definition: parse_param.c:286
void * p_ref_hook_state
Definition: parse_node.h:238
int * numParams
Definition: parse_param.c:51

References check_parameter_resolution_walker(), if(), VarParamState::numParams, ParseState::p_ref_hook_state, and query_tree_walker.

Referenced by parse_analyze_varparams().

◆ query_contains_extern_params()

bool query_contains_extern_params ( Query query)

Definition at line 330 of file parse_param.c.

331 {
332  return query_tree_walker(query,
334  NULL, 0);
335 }
static bool query_contains_extern_params_walker(Node *node, void *context)
Definition: parse_param.c:338

References query_contains_extern_params_walker(), and query_tree_walker.

Referenced by transformCreateTableAsStmt().

◆ setup_parse_fixed_parameters()

void setup_parse_fixed_parameters ( ParseState pstate,
const Oid paramTypes,
int  numParams 
)

Definition at line 67 of file parse_param.c.

69 {
70  FixedParamState *parstate = palloc(sizeof(FixedParamState));
71 
72  parstate->paramTypes = paramTypes;
73  parstate->numParams = numParams;
74  pstate->p_ref_hook_state = (void *) parstate;
76  /* no need to use p_coerce_param_hook */
77 }
void * palloc(Size size)
Definition: mcxt.c:1210
static Node * fixed_paramref_hook(ParseState *pstate, ParamRef *pref)
Definition: parse_param.c:99
const Oid * paramTypes
Definition: parse_param.c:38
ParseParamRefHook p_paramref_hook
Definition: parse_node.h:236

References fixed_paramref_hook(), FixedParamState::numParams, ParseState::p_paramref_hook, ParseState::p_ref_hook_state, palloc(), and FixedParamState::paramTypes.

Referenced by parse_analyze_fixedparams().

◆ setup_parse_variable_parameters()

void setup_parse_variable_parameters ( ParseState pstate,
Oid **  paramTypes,
int *  numParams 
)

Definition at line 83 of file parse_param.c.

85 {
86  VarParamState *parstate = palloc(sizeof(VarParamState));
87 
88  parstate->paramTypes = paramTypes;
89  parstate->numParams = numParams;
90  pstate->p_ref_hook_state = (void *) parstate;
93 }
static Node * variable_coerce_param_hook(ParseState *pstate, Param *param, Oid targetTypeId, int32 targetTypeMod, int location)
Definition: parse_param.c:186
static Node * variable_paramref_hook(ParseState *pstate, ParamRef *pref)
Definition: parse_param.c:131
CoerceParamHook p_coerce_param_hook
Definition: parse_node.h:237
Oid ** paramTypes
Definition: parse_param.c:50

References VarParamState::numParams, ParseState::p_coerce_param_hook, ParseState::p_paramref_hook, ParseState::p_ref_hook_state, palloc(), VarParamState::paramTypes, variable_coerce_param_hook(), and variable_paramref_hook().

Referenced by parse_analyze_varparams().