Re: BUG #18743: /src/backend/rewrite/rewriteHandler.c

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #18743: /src/backend/rewrite/rewriteHandler.c
Дата
Msg-id CAApHDvoxcTUcsG9dZKBJy+fxsEfHAjVnSm=c_3q_3jrGALtKmw@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #18743: /src/backend/rewrite/rewriteHandler.c  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Tue, 10 Dec 2024 at 03:14, PG Bug reporting form
<noreply@postgresql.org> wrote:
> After having been compared to a NULL value at rewriteHandler.c:852, pointer
> '(**new_tles[attrno - 1]).expr' is dereferenced at rewriteHandler.c:859.

I'm not sure if I follow the issue here. At 851 we have:

apply_default = ((new_tle == NULL && commandType == CMD_INSERT) ||
(new_tle && new_tle->expr && IsA(new_tle->expr, SetToDefault)));

and at 859:

if (values_rte && new_tle && IsA(new_tle->expr, Var))

I get that the code is a little convoluted here, but I don't spot the
issue. The "having been compared to a NULL" you mention is for setting
the apply_default variable, and that variable does not have any
influence on the if condition at 859.

Can you specifically state the scenario you think will be handled incorrectly?

David



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