Re: Duplicate function call on timestamp2tm - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Duplicate function call on timestamp2tm
Date
Msg-id 5511.1576163597@sss.pgh.pa.us
Whole thread Raw
In response to Re: Duplicate function call on timestamp2tm  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Duplicate function call on timestamp2tm
List pgsql-hackers
I wrote:
> Li Japin <japinli@hotmail.com> writes:
>> I find there is a duplicate function call on timestamp2tm in timestamptz_part and timestamp_part.
>> Is that necessary? I remove the latter one and it also works.

> Huh.  I do believe you're right.  Must be an ancient copy-and-paste
> mistake?

Ah, after looking in the git history, not quite that ancient:
this duplication dates to commit 258ee1b63, which moved these
switch cases from the "if (type == RESERV)" switches in the
same functions.  In the previous coding these function calls
were actually necessary, but here they're redundant.  I guess
that's just additional ammunition for Greg's point that the
keywords were misclassified ;-).

I see from the code coverage report that we're missing coverage
for these and some other paths in timestamp[tz]_part.  Think
I'll go add some more test cases while I'm at it.

Thanks again for the report!

            regards, tom lane



pgsql-hackers by date:

Previous
From: David Fetter
Date:
Subject: Re: Let people set host(no)ssl settings from initdb
Next
From: Robert Haas
Date:
Subject: Re: Wrong assert in TransactionGroupUpdateXidStatus