Re: A bug in make_outerjoininfo

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A bug in make_outerjoininfo
Дата
Msg-id 3385719.1675812825@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A bug in make_outerjoininfo  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: A bug in make_outerjoininfo  (Richard Guo <guofenglinux@gmail.com>)
Список pgsql-hackers
I wrote:
> Richard Guo <guofenglinux@gmail.com> writes:
>> In b448f1c8 remove_useless_result_rtes will remove useless FromExprs and
>> merge its quals up to parent.  This makes flag 'delay_upper_joins' not
>> necessary any more if the clauses between the two outer joins come from
>> FromExprs.  However, if the clauses between the two outer joins come
>> from JoinExpr of an inner join, it seems we have holes in preserving
>> ordering.

> Hmm ... we'll preserve the ordering all right, but if we set commute_below
> or commute_above_x bits that don't match reality then we'll have trouble
> later with mis-marked varnullingrels, the same as we saw in b2d0e13a0.
> I don't think you need a JoinExpr, an intermediate multi-member FromExpr
> should have the same effect.

BTW, the presented test case doesn't fail anymore after the fix
for bug #17781.  That's because build_joinrel_tlist() doesn't use
commute_above_l anymore at all, and is a bit more wary in its use of
commute_above_r.  I'm not sure that that completely eliminates this
problem, but it at least makes it a lot harder to reach.

We might want to see if we can devise a new example (or wait for
Robins to break it ;-)) before expending a lot of effort on making
the commute_xxx bits more precise.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Generating code for query jumbling through gen_node_support.pl
Следующее
От: Tatsuo Ishii
Дата:
Сообщение: Re: make_ctags: use -I option to ignore pg_node_attr macro