summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-12-16 14:53:58 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-12-16 14:53:58 -0500
commitf2a3cdb6dbe4984c7b5461ed4ece789eab2faf4a (patch)
tree8ac2e884b36448c73c394cfd4b2bb8ac7ee3c4b3
parent6c75384eed8770b11f01378b37dc4bd07a5710f1 (diff)
Suppress bogus statistics when pgbench failed to complete any transactions.
Code added in 9.4 would attempt to divide by zero in such cases. Noted while testing fix for missing-pclose problem.
-rw-r--r--contrib/pgbench/pgbench.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index bd5e265b84b..ed7fc1946eb 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -2299,6 +2299,10 @@ printResults(int ttype, int64 normal_xacts, int nclients,
normal_xacts);
}
+ /* Remaining stats are nonsensical if we failed to execute any xacts */
+ if (normal_xacts <= 0)
+ return;
+
if (throttle_delay || progress)
{
/* compute and show latency average and standard deviation */