Fix overflow hazard in timestamp_pl_interval - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Fix overflow hazard in timestamp_pl_interval
Date
Msg-id CAAvxfHf77sRHKoEzUw9_cMYSpbpNS2C+J_+8Dq4+0oi8iKopeA@mail.gmail.com
Whole thread Raw
Responses Re: Fix overflow hazard in timestamp_pl_interval
List pgsql-hackers
Hi all,

Attached is a patch that fixes some overflow/underflow hazards in
`timestamp_pl_interval`. The microseconds overflow could produce
incorrect result. The month overflow would generally still result in an
error from the timestamp month field being too low, but it's still
better to catch it early.

I couldn't find any existing timestamp plus interval tests so I stuck
a new tests in `timestamp.sql`. If there's a better place, then
please let me know.

Thanks,
Joe Koshakow
Attachment

pgsql-hackers by date:

Previous
From: Andy Fan
Date:
Subject: Re: a wrong index choose when statistics is out of date
Next
From: Joseph Koshakow
Date:
Subject: Re: Fix overflow hazard in timestamp_pl_interval