Re: Fix overflow in DecodeInterval

Поиск
Список
Период
Сортировка
От Joseph Koshakow
Тема Re: Fix overflow in DecodeInterval
Дата
Msg-id CAAvxfHecFFqpn=5H0T3N1Bki=rkgW0BmRNOZ1NZdKDMCOoy+Rw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix overflow in DecodeInterval  (Joseph Koshakow <koshy44@gmail.com>)
Ответы Re: Fix overflow in DecodeInterval  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Apr 1, 2022 at 8:06 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I think the patch can be salvaged, though.  I like the concept
> of converting all the sub-day fields to microseconds immediately,
> because it avoids a host of issues, so I don't want to give that up.
> What I'm going to look into is detecting the sign-adjustment-needed
> case up front (which is easy enough, since it's looking at the
> input data not the conversion results) and then forcing the
> individual field values negative before we accumulate them into
> the pg_itm_in struct.

I took a stab at this issue and the attached patch (which would be
applied on top of your v10 patch) seems to fix the issue. Feel
free to ignore it if you're already working on a fix.

- Joe

Вложения

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

Предыдущее
От: Joseph Koshakow
Дата:
Сообщение: Re: Fix overflow in DecodeInterval
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Fix overflow in DecodeInterval