Skip to content
Snippets Groups Projects
Commit b2ed8ede authored by Heikki Linnakangas's avatar Heikki Linnakangas
Browse files

Fix bug in collecting total_latencies from all threads in pgbench.

This was broken in 1bc90f7a, which removed the thread-emulation. With modest
-j and -c settings the result were usually close enough that you wouldn't
notice it easily, but with a high enough thread count it would access
uninitialized memory and crash.

Per report from Andres Freund offlist.
parent 5e65f45c
No related branches found
No related tags found
No related merge requests found
......@@ -3456,8 +3456,8 @@ main(int argc, char **argv)
for (j = 0; j < thread->nstate; j++)
{
total_xacts += thread->state[j].cnt;
total_latencies += thread->state[i].txn_latencies;
total_sqlats += thread->state[i].txn_sqlats;
total_latencies += thread->state[j].txn_latencies;
total_sqlats += thread->state[j].txn_sqlats;
}
}
disconnect_all(state, nclients);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment