Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitab8984f

Browse files
committed
Further adjustment to random() seed initialization.
Per complaint from Tom Lane, don't chomp the timestamp at 32 bits, so wecan shift in some of its higher bits.Discussion:https://postgr.es/m/14712.1542253115%40sss.pgh.pa.us
1 parent5b0ce3e commitab8984f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,9 +2532,9 @@ InitProcessGlobals(void)
25322532
* in a given time period. Since that would leave only 20 bits of the
25332533
* timestamp that cycle every ~1 second, also mix in some higher bits.
25342534
*/
2535-
srandom(((unsignedint)MyProcPid) ^
2536-
((unsignedint)MyStartTimestamp <<12) ^
2537-
((unsignedint)MyStartTimestamp >>20));
2535+
srandom(((uint64)MyProcPid) ^
2536+
((uint64)MyStartTimestamp <<12) ^
2537+
((uint64)MyStartTimestamp >>20));
25382538
}
25392539

25402540

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp