You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-4516 check for var_pop < 0
In some cases, because of rounding error, var_pop will evaluate to some value just less than 0. We check for this and force to round to 0.
This commit is contained in:
@ -129,6 +129,8 @@ mcsv1_UDAF::ReturnCode regr_syy::evaluate(mcsv1Context* context, static_any::any
|
||||
if (N > 0)
|
||||
{
|
||||
long double var_popy = (data->sumy2 - (data->sumy * data->sumy / N));
|
||||
if (var_popy < 0) // might be -0
|
||||
var_popy = 0;
|
||||
valOut = static_cast<double>(var_popy);
|
||||
}
|
||||
return mcsv1_UDAF::SUCCESS;
|
||||
|
Reference in New Issue
Block a user