Re: BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2
Дата
Msg-id CAMbWs4-zNHy3GAjiK7vnTEpU8eWiFRtHUB9s5mpo1Edhs=0Dfw@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #18184: ERROR: wrong varnullingrels (b) (expected (b 3)) for Var 2/2  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

On Mon, Nov 6, 2023 at 10:39 PM PG Bug reporting form <noreply@postgresql.org> wrote:
Hi,
We found a bug in PostgreSQL 16. I have simplified the case:

SELECT
function1(table1)
FROM table2
LEFT JOIN table1 ON table1_id = table2_id
LEFT JOIN LATERAL (SELECT 1 FROM table3) AS tx3 ON (true)
LIMIT 5;

ERROR:  wrong varnullingrels (b) (expected (b 3)) for Var 2/2

Thanks for the report!  This is an error message that hasn't been seen
in a long time.

It seems that when we optimize field selection from a whole-row Var into
a simple Var while simplifying functions, we fail to propagate the
nullingrels into the new Var.

Attached is a hotfix for this error.  But I'm wondering if there are
other similar cases where we have mismatched nullingrels that we haven't
discovered yet.  Any thoughts?

Thanks
Richard
Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: BUG #18177: certain queries under certain contexts take multiple orders of magnitude longer compared to v10
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: BUG #18185: Error when calling whoami at the beginning of the installation