From 369dc613c432ad89924e65e34c1152282df3f732 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Thu, 11 Feb 2021 19:05:17 +0300 Subject: [PATCH] Decimal binary operation constants fix --- src/Functions/FunctionBinaryArithmetic.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Functions/FunctionBinaryArithmetic.h b/src/Functions/FunctionBinaryArithmetic.h index f61c9c91d00..bb85ae32622 100644 --- a/src/Functions/FunctionBinaryArithmetic.h +++ b/src/Functions/FunctionBinaryArithmetic.h @@ -894,9 +894,8 @@ class FunctionBinaryArithmetic : public IFunction const NativeResultType const_b = helperGetOrConvert(col_right_const, right); const ResultType res = check_decimal_overflow - // the arguments are already scaled after conversion - ? OpImplCheck::template process(const_a, const_b, 1, 1) - : OpImpl::template process(const_a, const_b, 1, 1); + ? OpImplCheck::template process(const_a, const_b, scale_a, scale_b) + : OpImpl::template process(const_a, const_b, scale_a, scale_b); if constexpr (result_is_decimal) return ResultDataType(type.getPrecision(), type.getScale()).createColumnConst(