]> granicus.if.org Git - postgresql/commit
Fix interval division and multiplication, before:
authorBruce Momjian <bruce@momjian.us>
Wed, 20 Jul 2005 03:50:24 +0000 (03:50 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 20 Jul 2005 03:50:24 +0000 (03:50 +0000)
commit826604f9e61c233c4229a3eb4d1ee3945691ee1b
treefcd99f32749776c311c1b0f7d34c2fd1ee10e5c9
parentca76df425bddc050d83546a7a137d7621491ebaa
Fix interval division and multiplication, before:

test=> select '4 months'::interval / 5;
   ?column?
---------------
 1 mon -6 days
(1 row)

after:

test=> select '4 months'::interval / 5;
 ?column?
----------
 24 days
(1 row)

The problem was the use of rint() to round, and then find the remainder,
causing the negative values.
src/backend/utils/adt/timestamp.c