From 826498c9e5f26c0cbcbebaf1f9a17068f2f18940 Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 13 Apr 2011 16:15:11 +0000 Subject: [PATCH] Protect search against all-deleted bibs by pinning the estimation ratios in that case git-svn-id: svn://svn.open-ils.org/ILS/trunk@20069 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm index 3c7c06a1b..a2cc36ba7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/metabib.pm @@ -2657,10 +2657,10 @@ sub FTS_paging_estimate { my $delete_adjusted_total = $total - ( $total * $deleted_ratio ); my $exclusion_ratio = $excluded / $checked; - my $delete_adjusted_exclusion_ratio = $excluded / ($checked - $deleted); + my $delete_adjusted_exclusion_ratio = $checked - $deleted ? $excluded / ($checked - $deleted) : 1; my $inclusion_ratio = $visible / $checked; - my $delete_adjusted_inclusion_ratio = $visible / ($checked - $deleted); + my $delete_adjusted_inclusion_ratio = $checked - $deleted ? $visible / ($checked - $deleted) : 0; return { exclusion => int($delete_adjusted_total - ( $delete_adjusted_total * $exclusion_ratio )), -- 2.11.0