mirror of
https://github.com/postgres/postgres.git
synced 2025-05-15 19:15:29 +03:00
Back port patch.
Call srandom() instead of srand(). pgbench calls random() later, so it should have called srandom(). On most platforms except Windows srandom() is actually identical to srand(), so the bug only bites Windows users. per bug report from Akio Ishida.
This commit is contained in:
parent
2ece6917e8
commit
fe7b0fc35d
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.27.2.2 2003/12/07 19:56:07 tgl Exp $
|
* $Header: /cvsroot/pgsql/contrib/pgbench/pgbench.c,v 1.27.2.3 2007/01/13 03:24:55 ishii Exp $
|
||||||
*
|
*
|
||||||
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
|
* pgbench: a simple TPC-B like benchmark program for PostgreSQL
|
||||||
* written by Tatsuo Ishii
|
* written by Tatsuo Ishii
|
||||||
@ -935,7 +935,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* set random seed */
|
/* set random seed */
|
||||||
gettimeofday(&tv1, 0);
|
gettimeofday(&tv1, 0);
|
||||||
srand((uint) tv1.tv_usec);
|
srandom((uint) tv1.tv_usec);
|
||||||
|
|
||||||
/* get start up time */
|
/* get start up time */
|
||||||
gettimeofday(&tv1, 0);
|
gettimeofday(&tv1, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user