Re: pgsql: Use new overflow aware integer operations.

2017-12-16 Thread David Rowley
On 13 December 2017 at 14:01, Andres Freund wrote: > Use new overflow aware integer operations. Thanks for making this happen. I notice it's caused a small warning in compilers that don't understand about elog(ERROR) and ereport(ERROR) not returning. This can be seen on bowerbird's compile log

pgsql: Fix oversights in new plpgsql test suite infrastructure.

2017-12-16 Thread Tom Lane
Fix oversights in new plpgsql test suite infrastructure. Fix a couple of minor oversights in commit 632b03da3: the tests should be run in database "pl_regression" like the other PLs do, and we should clean up the tests' output cruft during "make clean". Branch -- master Details --- https

pgsql: Avoid and detect SIGPIPE race in TAP tests.

2017-12-16 Thread Noah Misch
Avoid and detect SIGPIPE race in TAP tests. Don't write to stdin of a psql process that could have already exited with an authentication failure. Buildfarm members crake and mandrill have failed once by doing so. Ignore SIGPIPE in all TAP tests. Back-patch to v10, where these tests were introduc

pgsql: Avoid and detect SIGPIPE race in TAP tests.

2017-12-16 Thread Noah Misch
Avoid and detect SIGPIPE race in TAP tests. Don't write to stdin of a psql process that could have already exited with an authentication failure. Buildfarm members crake and mandrill have failed once by doing so. Ignore SIGPIPE in all TAP tests. Back-patch to v10, where these tests were introduc

pgsql: Try to detect runtime unavailability of __builtin_mul_overflow(i

2017-12-16 Thread Andres Freund
Try to detect runtime unavailability of __builtin_mul_overflow(int64). On some systems the results of 64 bit __builtin_mul_overflow() operations can be computed at compile time, but not at runtime. The known cases are arm buildfar animals using clang where the runtime operation is implemented in a

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-16 Thread Andres Freund
On 2017-12-13 13:37:54 -0800, Andres Freund wrote: > Hi Michael, > > On 2017-12-13 01:01:19 +, Andres Freund wrote: > > Provide overflow safe integer math inline functions. > > https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=dangomushi&dt=2017-12-13%2018%3A00%3A18 > > which seems hal

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-16 Thread Tom Lane
Andres Freund writes: > I'm not quite following. Could you check if the same happens without > -O2? Not because that'd be a solution, but to narrow down how this > happens? The committed test looks quite broken to me: it's missing some & operators. Not sure how that translates into failing to fa

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-16 Thread Andres Freund
On December 16, 2017 5:31:01 PM PST, Tom Lane wrote: >Andres Freund writes: >> I'm not quite following. Could you check if the same happens without >> -O2? Not because that'd be a solution, but to narrow down how this >> happens? > >The committed test looks quite broken to me: it's missing some

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-16 Thread Tom Lane
Andres Freund writes: > On December 16, 2017 5:31:01 PM PST, Tom Lane wrote: >> The committed test looks quite broken to me: it's missing some & >> operators. Not sure how that translates into failing to fail the >> configure test, > Hm, true. As you say, it doesn't explain the problem though,

pgsql: Suppress compiler warning about no function return value.

2017-12-16 Thread Tom Lane
Suppress compiler warning about no function return value. Compilers that don't know that ereport(ERROR) doesn't return complained about the new coding in scanint8() introduced by commit 101c7ee3e. Tweak coding to avoid the warning. Per buildfarm. Branch -- master Details --- https://git

Re: pgsql: Provide overflow safe integer math inline functions.

2017-12-16 Thread Michael Paquier
On Sun, Dec 17, 2017 at 9:32 AM, Andres Freund wrote: > I've since tried this via the buildfarm, but still: > > configure:14480: checking for __builtin_mul_overflow > configure:14500: ccache clang -o conftest -Wall -Wmissing-prototypes > -Wpointer-arith -Wdeclaration-after-statement -Wendif-label