postgres.git / summary / log / commit / refs
commit ca0b960eb502db429d9134b0ddf24b9e12f45257
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sat Oct 20 16:44:18 2012 +0000
First released in: 9.3.0
Prevent overflow in pgbench's percent-done display.
Per Thom Brown.
contrib/pgbench/pgbench.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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"))
{
[parent: 5d1abe64e62f]