From: | Robert Haas <rhaas(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)postgresql(dot)org |
Subject: | pgsql: Modestly improve pgbench's checking for invalid ranges. |
Date: | 2011-08-05 16:54:36 |
Message-ID: | E1QpNfQ-0002AR-BR@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Modestly improve pgbench's checking for invalid ranges.
The old check against MAX_RANDOM_VALUE is clearly irrelevant since
getrand() no longer calls random(). Instead, check whether min and max
are close enough together to avoid an overflow inside getrand(), as
suggested by Tom Lane. This is still somewhat silly, because we're
using atoi(), which doesn't check for overflow anyway and (at least on
my system) will cheerfully return 0 when given "4294967296". But that's
a problem for another commit.
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/68cbb9f4e70b7b7ed515b5c63bafbe47d9617bf0
Modified Files
--------------
contrib/pgbench/pgbench.c | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2011-08-05 17:25:01 | pgsql: Allow per-column foreign data wrapper options. |
Previous Message | Robert Haas | 2011-08-05 16:11:05 | pgsql: Tweak PQresStatus() to avoid a clang compiler warning. |