]> granicus.if.org Git - postgresql/commit
Fix corner case bug in numeric to_char().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Sep 2011 21:06:19 +0000 (17:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Sep 2011 21:07:33 +0000 (17:07 -0400)
commit5df20a6e4f5eee5eef1b28760ceca604f57d535b
tree907f38f464e6a56e1941624b10f4bd97fd9cca70
parent60765d86c3a91bf2fdf796ee66672120fd599d02
Fix corner case bug in numeric to_char().

Trailing-zero stripping applied by the FM specifier could strip zeroes
to the left of the decimal point, for a format with no digit positions
after the decimal point (such as "FM999.").

Reported and diagnosed by Marti Raudsepp, though I didn't use his patch.
src/backend/utils/adt/formatting.c
src/test/regress/expected/numeric.out
src/test/regress/sql/numeric.sql