postgresql/src/bin/pgbench
Tom Lane 15783d0575 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:23:03 -05:00
..
t Rework PostgresNode's psql method 2016-03-03 17:58:30 -03:00
.gitignore Call xlc __isync() after, not before, associated compare-and-swap. 2016-02-19 22:47:50 -05:00
exprparse.y Rename pgbench min/max to least/greatest, and fix handling of double args. 2016-05-05 14:51:00 -04:00
exprscan.l Fix portability issues in 86c43f4e22. 2016-03-29 00:53:53 -04:00
Makefile Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
pgbench.c Fix integer-overflow edge case detection in interval_mul and pgbench. 2019-11-07 11:23:03 -05:00
pgbench.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00