Apparent bug in _make_subplan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Apparent bug in _make_subplan
Дата
Msg-id 1191.929574125@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
I have been looking at the planner's handling of subplans, and I see
something that I think is wrong, but I'm not quite certain.  In
_make_subplan() in backend/optimizer/plan/subselect.c, there is the
code
   /* make parParam list */   foreach(lst, plan->extParam)   {       Var      *var = nth(lfirsti(lst),
PlannerParamVar);
       if (var->varlevelsup == PlannerQueryLevel)           node->parParam = lappendi(node->parParam, lfirsti(lst));
}

It looks to me like this code is supposed to find parameters that
reference the immediate parent plan level, as opposed to higher levels.
So, shouldn't it be looking for varlevelsup == 1, not PlannerQueryLevel?

For a first-level subplan, PlannerQueryLevel will be 1 at the time
this code runs, so the result is the same anyway.  But I think it
does the wrong thing for more deeply nested subplans.  Am I right?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] SET QUERY_LIMIT bug report
Следующее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] 6.5.0 - Overflow bug in AVG( )