Skip to content
This repository was archived by the owner on Jul 6, 2021. It is now read-only.

Commit 83b6205

Browse files
committed
fix: errors in F004 (division by zero) and L003 (bugs on MacOS) fixed
1 parent ac8549e commit 83b6205

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

resources/checks/F004_heap_bloat.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ with data as (
7272
tblpages * bs as real_size,
7373
(tblpages - est_tblpages) * bs as extra_size,
7474
case
75-
when tblpages - est_tblpages > 0
75+
when (tblpages - est_tblpages > 0 and tblpages > 0)
7676
then 100 * (tblpages - est_tblpages) / tblpages::float
7777
else 0
7878
end as extra_ratio,
@@ -82,7 +82,7 @@ with data as (
8282
else 0
8383
end as bloat_size,
8484
case
85-
when tblpages - est_tblpages_ff > 0
85+
when (tblpages - est_tblpages_ff > 0 and tblpages > 0)
8686
then 100 * (tblpages - est_tblpages_ff) / tblpages::float
8787
else 0
8888
end as bloat_ratio

resources/checks/L003_integer_in_pk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ SQL
7777
result=$(cat $f_stderr)
7878
result=${result:23:$((${#result}))}
7979
tables_data=$(echo "$result" | jq -cs 'sort_by(-(.[]."capacity_used_percent"|tonumber)) | .[]' | jq -s add)
80-
let "min_table_size_bytes=$MIN_RELPAGES * 8192"
80+
min_table_size_bytes=$((MIN_RELPAGES * 8192))
8181

8282
echo "{\"tables\": $tables_data, \"min_table_size_bytes\": $min_table_size_bytes }"
8383

0 commit comments

Comments
 (0)