pgsql: Refactor script execution state machine in pgbench.

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема pgsql: Refactor script execution state machine in pgbench.
Дата
Msg-id E1boQmO-0000U8-0D@gemulon.postgresql.org
обсуждение исходный текст
Ответы Re: pgsql: Refactor script execution state machine in pgbench.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers
Refactor script execution state machine in pgbench.

The doCustom() function had grown into quite a mess. Rewrite it, in a more
explicit state machine style, for readability.

This also fixes one minor bug: if a script consisted entirely of meta
commands, doCustom() never returned to the caller, so progress reports
with the -P option were not printed. I don't want to backpatch this
refactoring, and the bug is quite insignificant, so only commit this to
master, and leave the bug unfixed in back-branches.

Review and original bug report by Fabien Coelho.

Discussion: <alpine.DEB.2.20.1607090850120.3412@sto>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/12788ae49e1933f463bc59a6efe46c4a01701b76

Modified Files
--------------
src/bin/pgbench/pgbench.c | 1106 +++++++++++++++++++++++++++------------------
1 file changed, 661 insertions(+), 445 deletions(-)


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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pgsql: pg_ctl: Detect current standby state from pg_control
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: pg_ctl: Detect current standby state from pg_control