From d0bb6fddbcb50fd0e9cc49a4784b386a117a405a Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 16 Oct 2019 10:08:47 -0500 Subject: [PATCH] Revert "MCOL-3518 Set number of decimals for regr_avgx and regr_avgy in init." This reverts commit c5cc5f20c969b957f48f0a1420d5bab216c62c1f. --- utils/regr/regrmysql.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/utils/regr/regrmysql.cpp b/utils/regr/regrmysql.cpp index a27d94a67..2570163f1 100644 --- a/utils/regr/regrmysql.cpp +++ b/utils/regr/regrmysql.cpp @@ -167,10 +167,14 @@ extern "C" strcpy(message,"regr_avgx() with a non-numeric independant (second) argument"); return 1; } - if (initid->decimals != DECIMAL_NOT_SPECIFIED) + if (args->arg_type[1] == DECIMAL_RESULT && initid->decimals != DECIMAL_NOT_SPECIFIED) { initid->decimals += 4; } + else + { + initid->decimals = DECIMAL_NOT_SPECIFIED; + } if (!(data = (struct regr_avgx_data*) malloc(sizeof(struct regr_avgx_data)))) { @@ -271,10 +275,14 @@ extern "C" return 1; } - if (initid->decimals != DECIMAL_NOT_SPECIFIED) + if (args->arg_type[0] == DECIMAL_RESULT && initid->decimals != DECIMAL_NOT_SPECIFIED) { initid->decimals += 4; } + else + { + initid->decimals = DECIMAL_NOT_SPECIFIED; + } if (!(data = (struct regr_avgy_data*) malloc(sizeof(struct regr_avgy_data)))) {