Commit 5515ec0b authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix calculation of latency of pgbench backslash commands.

When we loop back to the top of doCustom after processing a backslash
command, we must reset the "now" timestamp, because that's used to
calculate the time spent executing the previous command.

Report and fix by Fabien Coelho. Backpatch to 9.5, where this was broken.
parent a2932283
...@@ -1135,11 +1135,12 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa ...@@ -1135,11 +1135,12 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
* first time it's needed, and reuse the same value throughout this * first time it's needed, and reuse the same value throughout this
* function after that. This also ensures that e.g. the calculated latency * function after that. This also ensures that e.g. the calculated latency
* reported in the log file and in the totals are the same. Zero means * reported in the log file and in the totals are the same. Zero means
* "not set yet". * "not set yet". Reset "now" when we step to the next command with "goto
* top", though.
*/ */
top:
INSTR_TIME_SET_ZERO(now); INSTR_TIME_SET_ZERO(now);
top:
commands = sql_files[st->use_file]; commands = sql_files[st->use_file];
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment