On Mon, Aug 26, 2024 at 4:55 PM Anthonin Bonnefoy
<anthonin.bonne...@datadoghq.com> wrote:
>

  /* Evaluate parameters, if any */
  if (entry->plansource->num_params)
  {
- ParseState *pstate;
-
- pstate = make_parsestate(NULL);
- pstate->p_sourcetext = queryString;

you deleted the above these lines, but passed (ParseState *pstate) in
ExplainExecuteQuery
how do you make sure ExplainExecuteQuery passed (ParseState *pstate)
the p_next_resno is 1 and p_resolve_unknowns is true.
maybe we can add some Asserts like in ExplainExecuteQuery

    /* Evaluate parameters, if any */
    if (entry->plansource->num_params)
    {
        Assert(pstate->p_next_resno == 1);
        Assert(pstate->p_resolve_unknowns == 1);
   }



also it's ok to use passed (ParseState *pstate) for
{
        estate = CreateExecutorState();
        estate->es_param_list_info = params;
        paramLI = EvaluateParams(pstate, entry, execstmt->params, estate);
}
?
I really don't know.



some of the change is refactoring, maybe you can put it into a separate patch.


Reply via email to