]> 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:44 +0000 (17:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Sep 2011 21:06:44 +0000 (17:06 -0400)
commiteb9a98b6e2657ca65c4ddbe2536b26880864ff8f
tree89955c6d1f074578a5bf540b2b3911869c2eddd3
parent80360976e6d55f532d6c404bedcf06d5b10d7801
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