Subject: Re: Fix for edge case in date_bin() function

From: Moaaz Assali <[email-masked]>
Date: Tue, 27 Feb 2024 14:27:46 +0400

Hello Daniel,

I have added a test case for this in timestamp.sql and timestamp.out, and
tests pass when using the bug fix patch in the first email.
I have attached a new patch in this email below with the new tests only
(doesn't include the bug fix).

P.S. I forgot to CC the mailing list in my previous reply. This is just a
copy of it.

Best regards,
Moaaz Assali

On Tue, Feb 27, 2024 at 12:48 PM Daniel Gustafsson <[email-masked]> wrote:

> > On 27 Feb 2024, at 09:42, Moaaz Assali <[email-masked]> wrote:
>
> > To account for this edge, we simply add another condition in the if
> statement to not perform the subtraction by one stride interval if the time
> difference is divisible by the stride.
>
> I only skimmed the patch, but I recommend adding a testcase to it to keep
> the
> regression from reappearing.  src/test/regress/sql/timestamp.sql might be a
> good candidate testsuite.
>
> --
> Daniel Gustafsson
>
>