pgsql-server/src/backend/utils/adt numeric.c

Started by Tom Laneabout 23 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

CVSROOT: /cvsroot
Module name: pgsql-server
Changes by: tgl@svr1.postgresql.org 03/07/03 16:41:47

Modified files:
src/backend/utils/adt: numeric.c

Log message:
Fix bug I introduced in recent rewrite of NUMERIC code: numeric to
integer conversions gave the wrong answer for values with stripped
trailing zeroes, such as 10000000.

#2Alvaro Herrera
alvherre@dcc.uchile.cl
In reply to: Tom Lane (#1)
Re: pgsql-server/src/backend/utils/adt numeric.c

On Thu, Jul 03, 2003 at 04:41:48PM -0300, Tom Lane wrote:

Log message:
Fix bug I introduced in recent rewrite of NUMERIC code: numeric to
integer conversions gave the wrong answer for values with stripped
trailing zeroes, such as 10000000.

No regression test?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Porque francamente, si para saber manejarse a uno mismo hubiera que
rendir examen... �Qui�n es el machito que tendr�a carnet?" (Mafalda)

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#2)
Re: pgsql-server/src/backend/utils/adt numeric.c

Alvaro Herrera <alvherre@dcc.uchile.cl> writes:

Fix bug I introduced in recent rewrite of NUMERIC code: numeric to
integer conversions gave the wrong answer for values with stripped
trailing zeroes, such as 10000000.

No regression test?

Don't see the point --- it's a one-off fix. (Wrong loop termination
condition in one place.) I put in regression tests for things that
I think might break again in future, or if I can see a way to test for
a whole class of errors rather than one single routine.

regards, tom lane