Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc
Дата
Msg-id 2078959.1624453315@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc  (Greg Nancarrow <gregn4422@gmail.com>)
Ответы Re: Assertion failure in HEAD and 13 after calling COMMIT in a stored proc  (Greg Nancarrow <gregn4422@gmail.com>)
Список pgsql-hackers
Greg Nancarrow <gregn4422@gmail.com> writes:
> On Tue, Jun 22, 2021 at 10:56 PM Ranier Vilela <ranier.vf@gmail.com> wrote:
>> The comments in the function are clear:
>> If expression is mutable OR is a non-read-only function, so need a snapshot.

> I have to agree with you.
> Looks like the "&&" should really be an "||". The explanation in the
> code comment is pretty clear on this, as you say.

The code is correct as-is; the proposed change would result in taking
more snapshots than needed.  Perhaps the comment needs revision, since
you both misread it.  The comment is written in terms of "when can we
skip taking a snapshot", while the test in the code is written for
the inverse condition "when do we need a snapshot".

> I also verified that your patch seemed to fix the problem.

It accidentally masked it ... but only partially.

            regards, tom lane



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: PG 14 release notes, first draft
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: pgbench logging broken by time logic changes