projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d38e8d3
)
Suppress bogus statistics when pgbench failed to complete any transactions.
author
Tom Lane
<tgl@sss.pgh.pa.us>
Tue, 16 Dec 2014 19:53:55 +0000
(14:53 -0500)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Tue, 16 Dec 2014 19:53:55 +0000
(14:53 -0500)
Code added in 9.4 would attempt to divide by zero in such cases.
Noted while testing fix for missing-pclose problem.
contrib/pgbench/pgbench.c
patch
|
blob
|
blame
|
history
diff --git
a/contrib/pgbench/pgbench.c
b/contrib/pgbench/pgbench.c
index 397403f221c95baa69c198aa831af36a0d0e443f..d69036a2f5c36ed034341d0386f012377d45c759 100644
(file)
--- a/
contrib/pgbench/pgbench.c
+++ b/
contrib/pgbench/pgbench.c
@@
-2541,6
+2541,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 && latency_limit)
printf("number of transactions skipped: " INT64_FORMAT " (%.3f %%)\n",
throttle_latency_skipped,