Fix division by zero in the new range type histogram creation.
Report and analysis by Matthias.
This commit is contained in:
parent
a66fca3f0c
commit
3e6eb0dd0a
@ -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),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user