Hi Roman, Don, Phil,

Following Don's review, I put together a supplementary parser and test
patch on top of Roman's October 31 version. i also reproduced the reported
NaN assertion failure.

The patch uses the positive range check Don suggested, retaining the
existing strtod() and errno checks. It adds argument-error tests and short
SELECT 1 runs checking the output labels and formatting. Invalid-input
tests require the percentile diagnostic, exit status 1 and empty stdout;
a connection failure cannot satisfy them. The docs now show explicitly
that a list must be attached with "=".

I left repeated values accepted and preserved the supplied order, with
a test covering both. Is that the intended behavior? The patch also moves
the existing duplicate-option check ahead of both forms and rejects an
empty final list element. Thus bare/bare and explicit/bare repetitions
are rejected consistently, and "--latency-percentiles=50," reports an
invalid list. I can separate those choices from the NaN fix if preferred.

Both complete pgbench TAP tests pass (787 checks) with and without
assertions on Linux x86_64 with GCC 13.3, using master at 627c4df3b73a.
The builds used --enable-tap-tests --without-readline --without-zlib
--without-icu; the assertion build also used --enable-cassert. I have
not tested other platforms.

The attachment applies after the original feature patch.

Regards,
Zakhar Pashkin

Attachment: v2-0001-pgbench-validate-latency-percentile-options.patch
Description: Binary data

Reply via email to