[PATCH] Don't truncate integer part in to_char for 'FM99.'

From: Marti Raudsepp <marti(at)juffo(dot)org>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: [PATCH] Don't truncate integer part in to_char for 'FM99.'
Date: 2011-09-07 17:40:18
Message-ID: CABRT9RCesmv1BwWk=695Pph+aaTGCuJz4=r91Z1rtvdJ6NGqRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Don-t-truncate-integer-part-in-to_char-for-FM99.patch text/x-patch 2.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-09-07 17:44:48 Re: Large C files
Previous Message Magnus Hagander 2011-09-07 17:37:15 Re: timezone GUC