← Back to team overview

maria-developers team mailing list archive

Re: Please review MDEV-10468 Assertion `nr >= 0.0' failed in Item_sum_std::val_real()

 

Hi, Alexander!

On Aug 03, Alexander Barkov wrote:
> diff --git a/sql/item_sum.cc b/sql/item_sum.cc
> index adf48f6..03600b7 100644
> --- a/sql/item_sum.cc
> +++ b/sql/item_sum.cc
> @@ -1762,7 +1762,7 @@ double Item_sum_std::val_real()
>  {
>    DBUG_ASSERT(fixed == 1);
>    double nr= Item_sum_variance::val_real();
> -  DBUG_ASSERT(nr >= 0.0);
> +  DBUG_ASSERT(nr >= 0.0 || my_isinf(nr));
>    return sqrt(nr);
>  }

is it ok to do sqrt(inf)? what will it be? 0? inf? nan?
may be this should return NULL in inf case?

Regards,
Sergei
Chief Architect MariaDB
and security@xxxxxxxxxxx


Follow ups

References