Re: Fix overflow hazard in interval rounding

2024-06-02 Thread Joseph Koshakow
Hi Andres, Sorry for such a late reply. On Tue, Feb 13, 2024 at 2:14 PM Andres Freund wrote: > Random, mildly related thought: I wonder if it's time to, again, look at > enabling -ftrapv in assert enabled builds.I had looked at that a few years > back, and fixed a number of instances, but not a

Re: Fix overflow hazard in interval rounding

2024-02-13 Thread Tom Lane
Joseph Koshakow writes: > On Tue, Feb 13, 2024 at 1:46 PM Tom Lane wrote: >> (We'd need ereport in back branches, but this problem seems to >> me to probably not be worth back-patching.) > Agreed, this seems like a pretty rare overflow/underflow. OK, pushed to HEAD only. I converted the second

Re: Fix overflow hazard in interval rounding

2024-02-13 Thread Joseph Koshakow
On Tue, Feb 13, 2024 at 1:46 PM Tom Lane wrote: >I think you need to use ereturn not ereport here; see other error >cases in AdjustIntervalForTypmod. Attached is an updated patch that makes this adjustment. >(We'd need ereport in back branches, but this problem seems to >me to p

Re: Fix overflow hazard in interval rounding

2024-02-13 Thread Andres Freund
Hi, On 2024-02-13 13:31:22 -0500, Joseph Koshakow wrote: > Attached is a patch that fixes some overflow/underflow hazards that I > discovered in the interval rounding code. Random, mildly related thought: I wonder if it's time to, again, look at enabling -ftrapv in assert enabled builds. I had l

Re: Fix overflow hazard in interval rounding

2024-02-13 Thread Tom Lane
Joseph Koshakow writes: > Attached is a patch that fixes some overflow/underflow hazards that I > discovered in the interval rounding code. I think you need to use ereturn not ereport here; see other error cases in AdjustIntervalForTypmod. (We'd need ereport in back branches, but this problem se