Re: BUG #4231: Interval silent seconds 32-bit wraparound when given as text

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4231: Interval silent seconds 32-bit wraparound when given as text
Дата
Msg-id 25864.1213037114@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4231: Interval silent seconds 32-bit wraparound when given as text  ("Geoff Tolley" <geoff@polimetrix.com>)
Список pgsql-bugs
"Geoff Tolley" <geoff@polimetrix.com> writes:
> When you make an interval by giving it a text representation of a number of
> seconds, it appears to have a silent 32-bit wraparound (the example here is
> from some raw SPSS data from a colleague; apparently it uses October 14th
> 1584 as its base so the seconds output tends to be >> 2^31):

Hmm ... it works properly on a 32-bit machine ...

There are a boatload of occurrences of this pattern in datetime.c:

                    integer_variable = strtol(field[i], &cp, 10);
                    if (errno == ERANGE)
                        return DTERR_FIELD_OVERFLOW;

which is okay if long and int are the same size, but not so much
otherwise.  Looks like we need to fix that.

            regards, tom lane

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

Предыдущее
От: "Geoff Tolley"
Дата:
Сообщение: BUG #4231: Interval silent seconds 32-bit wraparound when given as text
Следующее
От: A.Anibayev@astel.kz
Дата:
Сообщение: