1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4188 Regression fixes for MCOL-641.

1. In BatchPrimitiveProcessorJL::countThisMsg(), exit early if the
return code from primproc is non-zero.
2. For statistical window functions (stddev/var), properly handle
the case when there is only one value for the calculation.
This commit is contained in:
Gagan Goel
2020-11-27 02:59:29 +00:00
parent 454ec4be99
commit 9c18771b61
2 changed files with 17 additions and 4 deletions

View File

@ -189,8 +189,7 @@ void WF_stats<T>::operator()(int64_t b, int64_t e, int64_t c)
fCount++;
}
if ((fCount > 0) &&
!(fCount == 1 && (fFunctionId == WF__STDDEV_SAMP || fFunctionId == WF__VAR_SAMP)))
if (fCount > 1)
{
int scale = fRow.getScale(colIn);
long double factor = pow(10.0, scale);
@ -225,9 +224,17 @@ void WF_stats<T>::operator()(int64_t b, int64_t e, int64_t c)
{
setValue(CalpontSystemCatalog::DOUBLE, b, e, c, (double*) NULL);
}
else if (fCount == 1 && (fFunctionId == WF__STDDEV_SAMP || fFunctionId == WF__VAR_SAMP))
else if (fCount == 1)
{
setValue(CalpontSystemCatalog::DOUBLE, b, e, c, (double*) NULL);
if (fFunctionId == WF__STDDEV_SAMP || fFunctionId == WF__VAR_SAMP)
{
setValue(CalpontSystemCatalog::DOUBLE, b, e, c, (double*) NULL);
}
else // fFunctionId == WF__STDDEV_POP || fFunctionId == WF__VAR_POP
{
double temp = 0.0;
setValue(CalpontSystemCatalog::DOUBLE, b, e, c, (double*) &temp);
}
}
else
{