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

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

Re: Fix overflow hazard in interval rounding

2024-02-13 Thread Joseph Koshakow
o >me to probably not be worth back-patching.) Agreed, this seems like a pretty rare overflow/underflow. Thanks, Joe Koshakow From 470aa9c8898b4e4ebbad97d6e421377b9a3e03cf Mon Sep 17 00:00:00 2001 From: Joseph Koshakow Date: Tue, 13 Feb 2024 13:06:13 -0500 Subject: [PATCH] Fix overflow hazard

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

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

Fix overflow hazard in interval rounding

2024-02-13 Thread Joseph Koshakow
&& src/tools/pgindent/pgindent src/backend/utils/adt/timestamp.c` Thanks, Joe Koshakow From 389b0d1e3f3cca6fca1e45fdd202b1ca066326c2 Mon Sep 17 00:00:00 2001 From: Joseph Koshakow Date: Tue, 13 Feb 2024 13:06:13 -0500 Subject: [PATCH] Fix overflow hazard in interval rounding This commit fixes