Обсуждение: BUG #4355: TOKMAXLEN=10 to short for token strings

Поиск
Список
Период
Сортировка

BUG #4355: TOKMAXLEN=10 to short for token strings

От
"Gerhard Leykam"
Дата:
The following bug has been logged online:

Bug reference:      4355
Logged by:          Gerhard Leykam
Email address:      gel123@sealsystems.de
PostgreSQL version: 8.3.1
Operating system:   HP-UX 11 64bit
Description:        TOKMAXLEN=10 to short for token strings
Details:

Hi!

Structure datetkn in src/include/utils/datetime.h has a character array
token of length 10 (TOKMAXLEN).
In src/backend/utils/adt/datetime.c two arrays of datetkn structures are
filled where some tokens exceed 10 bytes!
On HP-UX using aCC this gives startup errors as:

2008-09-04 07:13:41 GMT   LOG:  ordering error in deltatktbl table: "#mil"
>= "{llennia"
2008-09-04 07:13:41 GMT   LOG:  ordering error in deltatktbl table:
"{millenniu" >= "p{millisec"

To solve this for me i increased TOKMAXLEN to 16.

Regards,
  Gerhard Leykam

Re: BUG #4355: TOKMAXLEN=10 to short for token strings

От
Tom Lane
Дата:
"Gerhard Leykam" <gel123@sealsystems.de> writes:
> On HP-UX using aCC this gives startup errors as:

> 2008-09-04 07:13:41 GMT   LOG:  ordering error in deltatktbl table: "#mil"
>> = "{llennia"
> 2008-09-04 07:13:41 GMT   LOG:  ordering error in deltatktbl table:
> "{millenniu" >= "p{millisec"

Since no one else is reporting this, a reasonable conclusion is that
you have a broken compiler.

Note that there are not in fact any strings longer than 10 bytes
in the table --- there are some that would be 11 if they included
a null terminator, but we don't require that.

            regards, tom lane