Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger
Дата
Msg-id 492826.1705080506@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-bugs
Alexander Lakhin <exclusion@gmail.com> writes:
> 12.01.2024 17:56, Robert Haas wrote:
>> I don't understand why it's ever safe to skip ExecMaterializeSlot
>> here. IIUC, if we have no EPQ slot, newslot is still not materialized
>> and thus dependent on oldslot ... and we're about to
>> ExecFetchSlotHeapTuple on oldslot.

> To my understanding, when we have no epqslot_candidate, it means that
> newslot came from ExecBRUpdateTriggers's callers and it can't be dependent
> on an internal oldslot's buffer.

After sleeping on it, I'm inclined to the opinion that unconditionally
materializing newslot here is a good idea.  Given that we're about to
call one or more trigger functions, the incremental cost ought to be
pretty negligible.  The reduction in the state space that we have to
reason about seems fairly significant, too.  Remember that a trigger
function could do almost anything.  So I like this not only for
providing a straightforward fix for the current problem, but as a
guard against unrecognized or future bugs in this area.  75e03eabe
should be sufficient evidence that there's a lot of hazard here
(and I especially like being able to revert that wart).

            regards, tom lane



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

Предыдущее
От: Alexander Lakhin
Дата:
Сообщение: Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger
Следующее
От: PG Bug reporting form
Дата:
Сообщение: BUG #18289: postgresql14-devel-14.10-2PGDG.rhel8.x86_64.rpm Contains invalid cLang option in Makefile.global