1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-30 14:21:11 +03:00

Merge pull request #653 from mariadb-corporation/MCOL-1981

MCOL-1981 regr_avgx and regr_avgy should return NULL if count is zero
This commit is contained in:
Roman Nozdrin
2018-12-10 13:06:25 -08:00
committed by GitHub
2 changed files with 2 additions and 10 deletions

View File

@@ -123,11 +123,7 @@ mcsv1_UDAF::ReturnCode regr_avgx::evaluate(mcsv1Context* context, static_any::an
{
struct regr_avgx_data* data = (struct regr_avgx_data*)context->getUserData()->data;
if (data->cnt == 0)
{
valOut = 0;
}
else
if (data->cnt > 0)
{
valOut = data->sum / (double)data->cnt;
}

View File

@@ -121,11 +121,7 @@ mcsv1_UDAF::ReturnCode regr_avgy::evaluate(mcsv1Context* context, static_any::an
{
struct regr_avgy_data* data = (struct regr_avgy_data*)context->getUserData()->data;
if (data->cnt == 0)
{
valOut = 0;
}
else
if (data->cnt > 0)
{
valOut = data->sum / (double)data->cnt;
}