Re: Add support for AT LOCAL

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Add support for AT LOCAL
Дата
Msg-id ZS8gha6qJPJADZKe@paquier.xyz
обсуждение исходный текст
Ответ на Re: Add support for AT LOCAL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Oct 17, 2023 at 12:45:28PM -0400, Tom Lane wrote:
> Whoops, no: for negative starting values we'd need truncate-towards-
> minus-infinity division whereas C99 specifies truncate-towards-zero.
> However, the attached does pass for me on cfarm111 as well as my
> usual dev machine.

I guess that the following trick could be used for the negative case,
with one modulo followed by one extra addition:
if (result->time < INT64CONST(0))
{
    result->time %= USECS_PER_DAY;
    result->time += USECS_PER_DAY;
}

> Presumably this is a pre-existing bug that also appears in back
> branches.  But in the interests of science I propose that we
> back-patch only the test case and see which machine(s) fail it
> before back-patching the code change.

Sure, as you see fit.
--
Michael

Вложения

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: [PoC/RFC] Multiple passwords, interval expirations
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: New WAL record to detect the checkpoint redo location