postgresql/src/backend/utils
Tom Lane a7145f6bc8 Fix integer-overflow edge case detection in interval_mul and pgbench.
This patch adopts the overflow check logic introduced by commit cbdb8b4c0
into two more places.  interval_mul() failed to notice if it computed a
new microseconds value that was one more than INT64_MAX, and pgbench's
double-to-int64 logic had the same sorts of edge-case problems that
cbdb8b4c0 fixed in the core code.

To make this easier to get right in future, put the guts of the checks
into new macros in c.h, and add commentary about how to use the macros
correctly.

Back-patch to all supported branches, as we did with the previous fix.

Yuya Watari

Discussion: https://postgr.es/m/CAJ2pMkbkkFw2hb9Qb1Zj8d06EhWAQXFLy73St4qWv6aX=vqnjw@mail.gmail.com
2019-11-07 11:22:58 -05:00
..
adt Fix integer-overflow edge case detection in interval_mul and pgbench. 2019-11-07 11:22:58 -05:00
cache Add reusable routine for making arrays unique. 2019-11-07 17:00:48 +13:00
error Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
fmgr Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
hash Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
init Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
mb Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
misc Allow sampling of statements depending on duration 2019-11-06 19:11:07 +01:00
mmgr Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
resowner Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
sort Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
time Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
Gen_dummy_probes.pl Fix many typos and inconsistencies 2019-07-01 10:00:23 +09:00
Gen_dummy_probes.sed Update copyright for 2019 2019-01-02 12:44:25 -05:00
Gen_fmgrtab.pl Fix more typos and inconsistencies in the tree 2019-06-17 16:13:16 +09:00
Makefile Use Getopt::Long for catalog scripts 2019-02-12 12:22:08 -03:00
errcodes.txt Implement jsonpath .datetime() method 2019-09-25 22:51:51 +03:00
generate-errcodes.pl Update copyright for 2019 2019-01-02 12:44:25 -05:00
probes.d Sync our DTrace infrastructure with c.h's definition of type bool. 2019-11-06 11:11:40 -05:00