Re: [HACKERS] Bug in to_timestamp(). - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [HACKERS] Bug in to_timestamp().
Date
Msg-id CA+TgmoY2KAFz9H=kK0rh0ZYqVXXTOHACLbCHJV-eSwcNNn03Rg@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Bug in to_timestamp().  (Dmitry Dolgov <9erthalion6@gmail.com>)
Responses Re: [HACKERS] Bug in to_timestamp().  (Dmitry Dolgov <9erthalion6@gmail.com>)
List pgsql-hackers
On Wed, Jan 31, 2018 at 11:53 AM, Dmitry Dolgov <9erthalion6@gmail.com> wrote:
> Why not write `is_separator_char` using `isprint`, `isalpha`, `isdigit` from
> ctype.h? Something like:
>
>     return isprint(*str) && !isalpha(*str) && !isdigit(*str)
>
> From what I see in the source code they do exactly the same and tests are
> successfully passing with this change.

I'm not quite sure whether it's relevant here, but I think some of the
ctype.h functions have locale-dependent behavior.  By implementing our
own test we make sure that we don't accidentally inherit any such
behavior.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Changing WAL Header to reduce contention during ReserveXLogInsertLocation()
Next
From: Peter Geoghegan
Date:
Subject: Re: Wait for parallel workers to attach