Commit 79cebf82 authored by Paul Ramsey's avatar Paul Ramsey

Guard against crazy selectivity numbers


git-svn-id: http://svn.osgeo.org/postgis/trunk@13600 b70326c6-7e19-0410-871a-916f4a2858ee
parent a3e64724
......@@ -1091,9 +1091,15 @@ estimate_join_selectivity(const ND_STATS *s1, const ND_STATS *s2)
*/
selectivity = val / ntuples_max;
/* Guard against over-estimates :) */
if ( selectivity > 1.0 )
selectivity = 1.0;
/* Guard against over-estimates and crazy numbers :) */
if ( isnan(selectivity) || ! isfinite(selectivity) || selectivity < 0.0 )
{
selectivity = DEFAULT_ND_JOINSEL;
}
else if ( selectivity > 1.0 )
{
selectivity = 1.0;
}
return selectivity;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment