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

Commit0d68ad3

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 parent5129026 commit0d68ad3

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
@@ -833,7 +833,7 @@ _bt_vacuum_needs_cleanup(IndexVacuumInfo *info)
833833
prev_num_heap_tuples=metad->btm_last_cleanup_num_heap_tuples;
834834

835835
if (cleanup_scale_factor <=0||
836-
prev_num_heap_tuples<0||
836+
prev_num_heap_tuples <=0||
837837
(info->num_heap_tuples-prev_num_heap_tuples) /
838838
prev_num_heap_tuples >=cleanup_scale_factor)
839839
result= true;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp