Re: Assert failure of the cross-check for nullingrels

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: Assert failure of the cross-check for nullingrels
Дата
Msg-id CAMbWs49HwGv6UU1E23J60yU0qFc4m4j_mxyg6xUU3tN2ocks+A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Assert failure of the cross-check for nullingrels  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Assert failure of the cross-check for nullingrels  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On Thu, May 18, 2023 at 3:34 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
After some poking at it I hit on what seems like a really simple
solution: we should be checking syn_righthand not min_righthand
to see whether a Var should be considered nullable by a given OJ.
Maybe that's still not quite right, but it seems like it might be
right given that the last fix reaffirmed our conviction that Vars
should be marked according to the syntactic structure.

I thought about this solution before but proved it was not right in
https://www.postgresql.org/message-id/CAMbWs48fObJJ%3DYVb4ip8tnwxwixUNKUThfnA1eGfPzJxJRRgZQ%40mail.gmail.com

I checked the query shown there and it still fails with v3 patch.

explain (costs off)
select * from t1
    left join (select t2.x from t2
                      left join t3 on t2.x where t3.x is null) s
    left join t4 on s.x
on s.x = t1.x;
server closed the connection unexpectedly

The failure happens when we are forming the join of (t1/t2) to t3.
Consider qual 't3.x is null'.  It's a non-clone filter clause so
clause_is_computable_at is supposed to think it's applicable here.  We
have an Assert for that.  However, when checking outer join t1/t2, which
has been performed but is not listed in the qual's nullingrels,
clause_is_computable_at would think it'd null vars of the qual if we
check syn_righthand not min_righthand, and get a conclusion that the
qual is not applicable here.  This is how the Assert is triggered.

Thanks
Richard

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: Should CSV parsing be stricter about mid-field quotes?
Следующее
От: Richard Guo
Дата:
Сообщение: Re: Assert failure of the cross-check for nullingrels