aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/array_userfuncs.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-10-24 16:55:22 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-10-24 17:00:18 +0300
commit98c50656cac2e6b873419fd09569a9119c02148c (patch)
tree4312787ab93fc11ec916254904da1bd0a5ed97a4 /src/backend/utils/adt/array_userfuncs.c
parent75fdcec14543b60cc0c67483d8cc47d5c7adf1a8 (diff)
downloadpostgresql-98c50656cac2e6b873419fd09569a9119c02148c.tar.gz
postgresql-98c50656cac2e6b873419fd09569a9119c02148c.zip
Increase the number of different values used when seeding random().
When a backend process is forked, we initialize the system's random number generator with srandom(). The seed used is derived from the backend's pid and the timestamp. However, we only used the microseconds part of the timestamp, and it was XORed with the pid, so the total range of different seed values chosen was 0-999999. That's quite limited. Change the code to also use the seconds part of the timestamp in the seed, and shift the microseconds so that all 32 bits of the seed are used. Honza Horak
Diffstat (limited to 'src/backend/utils/adt/array_userfuncs.c')
0 files changed, 0 insertions, 0 deletions