pgbench: Make set_random_seed() 64-bit everywhere.
Peter Eisentraut <peter@eisentraut.org>
pgbench: Make set_random_seed() 64-bit everywhere. Delete an intermediate variable, a redundant cast, a use of long and a use of long long. scanf() the seed directly into a uint64, now that we can do that with SCNu64 from <inttypes.h>. The previous coding was from pre-C99 times when %lld might not have been there, so it read into an unsigned long. Therefore behavior varied by OS, and --random-seed would accept either 32 or 64 bit seeds. Now it's the same everywhere. Author: Thomas Munro <thomas.munro@gmail.com> Discussion: https://postgr.es/m/b936d2fb-590d-49c3-a615-92c3a88c6c19%40eisentraut.org
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pgbench/pgbench.c | modified | +3 −7 |
Discussion
- Cannot find a working 64-bit integer type on Illumos 71 messages · 2024-03-22 → 2025-09-16