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

Поиск
Список
Период
Сортировка
От Alexander Lakhin
Тема Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger
Дата
Msg-id f5ff446f-72e2-44f7-80c6-4256cf7caeb3@gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: BUG #17798: Incorrect memory access occurs when using BEFORE ROW UPDATE trigger  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-bugs
Hello Richard,

19.04.2023 11:29, Richard Guo wrote:
I have a second look at this issue and now I think the fix in v1 patch
is correct.  I think the comment needs to be updated for this change,
maybe something like

  * (Typically, newslot was also generated by ExecGetUpdateNewTuple, so
  * that epqslot_clean will be that same slot and the copy step below
- * is not needed.)
+ * is not needed.  And we need to materialize newslot in this case,
+ * since its tuple might be dependent on oldslot's storage, which
+ * might not be a local copy and be freed before we fetch newslot's
+ * tuple.)

Thanks for looking into this!

I've updated the comment based on your suggestion. Please look at the patch
attached.

I hesitate to add the isolation test to the patch as adding a dedicated
test just for this case seems too wasteful to me. Maybe that scenario could
be added to one of the existing trigger-related tests, but I couldn't find a
test, which is generic enough for that.

Best regards,
Alexander
Вложения

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

Предыдущее
От: Tobias Bussmann
Дата:
Сообщение: Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: pg_basebackup: errors on macOS on directories with ".DS_Store" files