aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-10-20 12:44:18 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2012-10-20 12:44:18 -0400
commitca0b960eb502db429d9134b0ddf24b9e12f45257 (patch)
tree43e1a020c08abced471fe2b606f47fc0039839f3
parent5d1abe64e62f2bb3c1a8a4181974f0b17b8bc21d (diff)
downloadpostgresql-ca0b960eb502db429d9134b0ddf24b9e12f45257.tar.gz
postgresql-ca0b960eb502db429d9134b0ddf24b9e12f45257.zip
Prevent overflow in pgbench's percent-done display.
Per Thom Brown.
-rw-r--r--contrib/pgbench/pgbench.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c
index 5d48aeeae47..090c21019e6 100644
--- a/contrib/pgbench/pgbench.c
+++ b/contrib/pgbench/pgbench.c
@@ -1444,7 +1444,7 @@ init(bool is_no_vacuum)
if (j % 100000 == 0)
fprintf(stderr, "%d of %d tuples (%d%%) done.\n",
j, naccounts * scale,
- j * 100 / (naccounts * scale));
+ (int) (((int64) j * 100) / (naccounts * scale)));
}
if (PQputline(con, "\\.\n"))
{