postgresql/src/backend
Tom Lane 26ae3aa80e Remove redundant function calls in timestamp[tz]_part().
The DTK_DOW/DTK_ISODOW and DTK_DOY switch cases in timestamp_part() and
timestamptz_part() contained calls of timestamp2tm() that were fully
redundant with the ones done just above the switch.  This evidently crept
in during commit 258ee1b63, which relocated that code from another place
where the calls were indeed needed.  Just delete the redundant calls.

I (tgl) noted that our test coverage of these functions left quite a
bit to be desired, so extend timestamp.sql and timestamptz.sql to
cover all the branches.

Back-patch to all supported branches, as the previous commit was.
There's no real issue here other than some wasted cycles in some
not-too-heavily-used code paths, but the test coverage seems valuable.

Report and patch by Li Japin; test case adjustments by me.

Discussion: https://postgr.es/m/SG2PR06MB37762CAE45DB0F6CA7001EA9B6550@SG2PR06MB3776.apcprd06.prod.outlook.com
2019-12-12 12:12:49 -05:00
..
access Fix thinkos from commit 9989d37 2019-12-03 18:59:09 +09:00
bootstrap Remove configure --disable-float4-byval 2019-11-21 18:29:21 +01:00
catalog Fix misbehavior with expression indexes on ON COMMIT DELETE ROWS tables. 2019-12-01 13:09:26 -05:00
commands Further adjust EXPLAIN's choices of table alias names. 2019-12-11 17:05:18 -05:00
executor Allow executor startup pruning to prune all child nodes. 2019-12-11 17:05:30 -05:00
foreign Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
jit Remove useless "return;" lines 2019-11-28 16:48:37 -03:00
lib Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
libpq Remove useless "return;" lines 2019-11-28 16:48:37 -03:00
main Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
nodes Add readfuncs.c support for AppendRelInfo. 2019-12-11 19:08:16 -05:00
optimizer Further adjust EXPLAIN's choices of table alias names. 2019-12-11 17:05:18 -05:00
parser Disallow non-default collation in ADD PRIMARY KEY/UNIQUE USING INDEX. 2019-12-06 11:25:09 -05:00
partitioning Remove extra parenthesis from comment. 2019-12-12 15:45:00 +09:00
po Translation updates 2019-06-17 15:30:20 +02:00
port Use only one thread to handle incoming signals on Windows. 2019-12-11 15:09:54 -05:00
postmaster Use procsignal_sigusr1_handler for auxiliary processes. 2019-11-25 16:16:27 -05:00
regex Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
replication Remove XLogFileNameP() from the tree 2019-12-03 15:06:04 +09:00
rewrite Remove useless "return;" lines 2019-11-28 16:48:37 -03:00
snowball Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
statistics Remove unnecessary clauses_attnums variable 2019-11-28 23:25:14 +01:00
storage Add safeguards for pg_fsync() called with incorrectly-opened fds 2019-11-26 13:32:52 +09:00
tcop Emit parameter values during query bind/execute errors 2019-12-11 18:03:35 -03:00
tsearch Make the order of the header file includes consistent in backend modules. 2019-11-12 08:30:16 +05:30
utils Remove redundant function calls in timestamp[tz]_part(). 2019-12-12 12:12:49 -05:00
.gitignore
common.mk
Makefile Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
nls.mk Translation updates 2019-05-20 16:00:53 +02:00