]> 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:26 +0000 (17:06 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Sep 2011 21:06:26 +0000 (17:06 -0400)
commit6e7a3c364bf5df266bb7000ead399e779410962c
tree7d8587c8798bebccfc9c4844e45daa2597e4398b
parentc3106a340f3177105b80a0a6e878eba1986ae9fe
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