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

Commit24bf2ee

Browse files
committed
Fix bug in calculations of hash join buckets.
Commit8cce08f used a left-shifton a literal of 1 that could (in large allocations) be shifted by31 or more bits. This was assigned to a local variable that wasalready declared to be a long to protect against overruns of int,but the literal in this shift needs to be declared long to allow itto work correctly in some compilers.Backpatch to 9.5, where the bug was introduced.Report and patch by KaiGai Kohei, slighly modified based ondiscussion.
1 parent4c3754f commit24bf2ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/executor/nodeHash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ ExecChooseHashTableSize(double ntuples, int tupwidth, bool useskew,
518518
* overhead for the hash code, pointer to the next tuple, etc.
519519
*/
520520
bucket_size= (tupsize*NTUP_PER_BUCKET+sizeof(HashJoinTuple));
521-
lbuckets=1 <<my_log2(hash_table_bytes /bucket_size);
521+
lbuckets=1L <<my_log2(hash_table_bytes /bucket_size);
522522
lbuckets=Min(lbuckets,max_pointers);
523523
nbuckets= (int)lbuckets;
524524
bucket_bytes=nbuckets*sizeof(HashJoinTuple);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp