Commit 3e6eb0dd authored by Heikki Linnakangas's avatar Heikki Linnakangas

Fix division by zero in the new range type histogram creation.

Report and analysis by Matthias.
parent a66fca3f
...@@ -158,7 +158,10 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc, ...@@ -158,7 +158,10 @@ compute_range_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
/* Must copy the target values into anl_context */ /* Must copy the target values into anl_context */
old_cxt = MemoryContextSwitchTo(stats->anl_context); old_cxt = MemoryContextSwitchTo(stats->anl_context);
if (non_empty_cnt > 0) /*
* Generate a histogram slot entry if there are at least two values.
*/
if (non_empty_cnt >= 2)
{ {
/* Sort bound values */ /* Sort bound values */
qsort_arg(lowers, non_empty_cnt, sizeof(RangeBound), qsort_arg(lowers, non_empty_cnt, sizeof(RangeBound),
......
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