1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Merge branch 'develop-1.2' into develop-merge-up-20190924-2

This commit is contained in:
Andrew Hutchings
2019-09-24 14:17:57 +01:00
25 changed files with 304 additions and 222 deletions

View File

@ -140,6 +140,7 @@ void WF_stats<T>::resetData()
template<typename T>
void WF_stats<T>::operator()(int64_t b, int64_t e, int64_t c)
{
CDT cdt;
if ((fFrameUnit == WF__FRAME_ROWS) ||
(fPrev == -1) ||
(!fPeer->operator()(getPointer(fRowData->at(c)), getPointer(fRowData->at(fPrev)))))
@ -163,7 +164,7 @@ void WF_stats<T>::operator()(int64_t b, int64_t e, int64_t c)
continue;
T valIn;
getValue(colIn, valIn);
getValue(colIn, valIn, &cdt);
long double val = (long double) valIn;
fSum1 += val;
@ -177,7 +178,9 @@ void WF_stats<T>::operator()(int64_t b, int64_t e, int64_t c)
int scale = fRow.getScale(colIn);
long double factor = pow(10.0, scale);
if (scale != 0) // adjust the scale if necessary
// adjust the scale if necessary
if (scale != 0 &&
cdt != CalpontSystemCatalog::LONGDOUBLE)
{
fSum1 /= factor;
fSum2 /= factor * factor;

View File

@ -264,13 +264,15 @@ void WF_sum_avg<T>::operator()(int64_t b, int64_t e, int64_t c)
continue;
T valIn;
getValue(colIn, valIn);
CDT cdt;
getValue(colIn, valIn, &cdt);
// checkSumLimit(fSum, valIn);
if ((!fDistinct) || (fSet.find(valIn) == fSet.end()))
{
long double val = valIn;
if (scale)
if (scale &&
cdt != CalpontSystemCatalog::LONGDOUBLE)
{
val /= pow(10.0, scale);
}