← Back to team overview

maria-developers team mailing list archive

Re: MDEV-4511 Assertion `scale <= precision' fails on GROUP BY TIMEDIFF with incorrect types

 

Hi, Alexander!

On Jul 24, Alexander Barkov wrote:
> 
>    uint divisor_precision_increment() const
>    {
>      return decimals >= NOT_FIXED_DEC &&
>             is_temporal_type_with_time(field_type()) ?
>             TIME_SECOND_PART_DIGITS : decimals;
>    }

Could you please rewrite divisor_precision_increment() as:

  uint divisor_precision_increment() const
  {
    return decimals < NOT_FIXED_DEC ? decimals :
           is_temporal_type_with_time(field_type()) ?
           TIME_SECOND_PART_DIGITS : decimals;
  }

it's equivalent to your original expression, but makes it obvious the
difference between divisor_precision_increment() and decimal_scale().

Thanks!

Regards,
Sergei


References