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

Commit1e87198

Browse files
committed
Fix division by zero in _bt_vacuum_needs_cleanup()
Checks inside _bt_vacuum_needs_cleanup() allow division by zero to happen whenmetad->btm_last_cleanup_num_heap_tuples == 0. This commit adjusts theexpression so that no division by zero might happen.Reported-by: Piotr StefaniakDiscussion:https://postgr.es/m/DB8PR03MB5931C41F7787A95313F08322F22A0%40DB8PR03MB5931.eurprd03.prod.outlook.comReviewed-by: Masahiko SawadaBackpatch-through: 11
1 parent3a45321 commit1e87198

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/backend/access/nbtree/nbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info)
835835
prev_num_heap_tuples=metad->btm_last_cleanup_num_heap_tuples;
836836

837837
if (cleanup_scale_factor <=0||
838-
prev_num_heap_tuples<0||
838+
prev_num_heap_tuples <=0||
839839
(info->num_heap_tuples-prev_num_heap_tuples) /
840840
prev_num_heap_tuples >=cleanup_scale_factor)
841841
result= true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp