Skip to content

Commit ca0b960

Browse files
committed
Prevent overflow in pgbench's percent-done display.
Per Thom Brown.
1 parent 5d1abe6 commit ca0b960

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/pgbench/pgbench.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ init(bool is_no_vacuum)
14441444
if (j % 100000 == 0)
14451445
fprintf(stderr, "%d of %d tuples (%d%%) done.\n",
14461446
j, naccounts * scale,
1447-
j * 100 / (naccounts * scale));
1447+
(int) (((int64) j * 100) / (naccounts * scale)));
14481448
}
14491449
if (PQputline(con, "\\.\n"))
14501450
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy