pgsql: Fix newly-introduced issues in pgbench.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix newly-introduced issues in pgbench.
Дата
Msg-id E1bogBh-0000vM-CF@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix newly-introduced issues in pgbench.

The result of FD_ISSET() doesn't necessarily fit in a bool, though
assigning it to one might accidentally work depending on platform and which
socket FD number is being inquired of.  Rewrite to test it with if(),
rather than making any specific assumption about the result width,
to match the way every other such call in PG is written.

Don't break out of the input_mask-filling loop after finding the first
client that we're waiting for results from.  That mostly breaks parallel
query management.

Also, if we choose not to call select(), be sure to clear out any bits
the mask-filling loop might have set, so that we don't accidentally call
doCustom for clients we don't know have input.  Doing so would likely
be harmless, but it's a waste of cycles and doesn't seem to be intended.

Make this_usec wide enough.  (Yeah, the value would usually fit in an
int, but then why are we using int64 everywhere else?)

Minor cosmetic adjustments, mostly comment improvements.

Problems introduced by commit 12788ae49.  The first issue was discovered
by buildfarm testing, the others by code review.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9779bda86c026e645773a3308f9169c7c0791f7c

Modified Files
--------------
src/bin/pgbench/pgbench.c | 82 ++++++++++++++++++++++++++++-------------------
1 file changed, 49 insertions(+), 33 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pgsql: pg_ctl: Detect current standby state from pg_control
Следующее
От: Peter Eisentraut
Дата:
Сообщение: pgsql: Fix some typos in comment