mirror of
https://github.com/postgres/postgres.git
synced 2025-08-11 04:22:52 +03:00
pgbench: Fix overflow in table populating when rows >= 2^31-1
Using a scale factor large enough so as the number of rows to insert
gets larger than INT32_MAX would cause an infinite loop in
initPopulateTable(), preventing pgbench to finish its initialization.
Oversight in e35cc3b3f2
that has refactored the data generation logic.
Author: John Hsu
Reviewed-by: Tatsuo Ishii, Japin Li
Discussion: https://postgr.es/m/CA+-JvFvHsOafjHcuFPfkyouHNZvbOXhBNhwZxKm3WNgYz9bwzA@mail.gmail.com
This commit is contained in:
@@ -4908,7 +4908,7 @@ initPopulateTable(PGconn *con, const char *table, int64 base,
|
|||||||
initRowMethod init_row)
|
initRowMethod init_row)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
int k;
|
int64 k;
|
||||||
int chars = 0;
|
int chars = 0;
|
||||||
PGresult *res;
|
PGresult *res;
|
||||||
PQExpBufferData sql;
|
PQExpBufferData sql;
|
||||||
|
Reference in New Issue
Block a user