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
Fix another 0 count error in dropValue
This commit is contained in:
committed by
Leonid Fedorov
parent
e7cab8445c
commit
680633a350
@ -158,11 +158,18 @@ mcsv1_UDAF::ReturnCode regr_syy::dropValue(mcsv1Context* context, ColumnDatum* v
|
||||
long double cyPrev = data->cy;
|
||||
--data->cnt;
|
||||
uint64_t cnt = data->cnt;
|
||||
long double dy = valy - avgyPrev;
|
||||
avgyPrev -= dy / cnt;
|
||||
cyPrev -= dy * (valy - avgyPrev);
|
||||
data->avgy = avgyPrev;
|
||||
data->cy = cyPrev;
|
||||
|
||||
if (cnt == 0)
|
||||
{
|
||||
data->avgy = 0;
|
||||
data->cx = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
long double dy = valy - avgyPrev;
|
||||
avgyPrev -= dy / cnt;
|
||||
cyPrev -= dy * (valy - avgyPrev);
|
||||
data->avgy = avgyPrev;
|
||||
data->cy = cyPrev;
|
||||
}
|
||||
return mcsv1_UDAF::SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user