Re: Fix overflow in DecodeInterval

Поиск
Список
Период
Сортировка
От Joseph Koshakow
Тема Re: Fix overflow in DecodeInterval
Дата
Msg-id CAAvxfHfKYHw8n19s7eAcDo_B2T1SS22O1p0X4OE5_WBK230O+Q@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix overflow in DecodeInterval  (Andres Freund <andres@anarazel.de>)
Ответы Re: Fix overflow in DecodeInterval  (Joseph Koshakow <koshy44@gmail.com>)
Список pgsql-hackers
Ok, so I've attached a patch with my final unprompted changes. It
contains the following two changes:

1. I found some more overflows with the ISO8601 formats and have
included some fixes.
2. I reverted the overflow checks for the seconds field. It's actually a
bit more complicated than I thought. For example consider the following
query:
    postgres=# SELECT INTERVAL '0.99999999 min 2147483647 sec';
            interval
    ----------------------
    -596523:13:09.000001
    (1 row)
This query will overflow the tm_sec field of the struct pg_tm, however
it's not actually out of range for the Interval. I'm not sure the best
way to handle this right now, but I think it would be best to leave it
for a future patch. Perhaps the time related fields in struct pg_tm
need to be changed to 64 bit ints.

- Joe Koshakow

Вложения

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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: Support escape sequence for cluster_name in postgres_fdw.application_name
Следующее
От: Ajin Cherian
Дата:
Сообщение: Re: Logical replication timeout problem