Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)

Поиск
Список
Период
Сортировка
От Dmitry Dolgov
Тема Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Дата
Msg-id CA+q6zcXXYdee8vyjxNqk7SPXhwSz9SrpDNTQDF=Yz_0C8LGgzw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> On Thu, Apr 25, 2019 at 8:24 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> The proximate cause of the crash is that we have {PARAM 1}
> (representing the output of the InitPlan) in the path's fdw_exprs, and
> also the identical expression in fdw_scan_tlist, and that means that when
> setrefs.c processes the ForeignScan node it thinks it should replace the
> {PARAM 1} in fdw_exprs with a Var representing a reference to the
> fdw_scan_tlist entry.

I've noticed, that it behaves like that since f9f63ed1f2e5 (originally I found
it pretty strange, but after this explanation it does make sense). As an
experiment, I've changed the position of condition of

    if (context->subplan_itlist->has_non_vars)

back - it also made problem to disappear, and what was interesting is that the
test case for update (exactly what this commit was fixing) is not crashing
either. I've checked on the commit right before f9f63ed1f2e5, without mentioned
reordering there is a crash, but I couldn't reproduce it on the master.



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)