[PATCH] Don't truncate integer part in to_char for 'FM99.' - Mailing list pgsql-hackers

From Marti Raudsepp
Subject [PATCH] Don't truncate integer part in to_char for 'FM99.'
Date
Msg-id CABRT9RCesmv1BwWk=695Pph+aaTGCuJz4=r91Z1rtvdJ6NGqRw@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Don't truncate integer part in to_char for 'FM99.'
List pgsql-hackers
Hi,

This patch fixes an edge case bug in the numeric to_char() function.

When the numeric to_char format used fillmode (FM), didn't contain 0s
and had a trailing dot, the integer part of the number was truncated in
error.

to_char(10, 'FM99.') used to return '1', after this patch it will return '10'

This is known to affect the format() function in the mysqlcompat
pgFoundry project.

Regards,
Marti

Attachment

pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: timezone GUC
Next
From: Robert Haas
Date:
Subject: Re: Large C files