diff --git a/src/Functions/FunctionBinaryArithmetic.h b/src/Functions/FunctionBinaryArithmetic.h index b2ea79cea61..f3904ae764e 100644 --- a/src/Functions/FunctionBinaryArithmetic.h +++ b/src/Functions/FunctionBinaryArithmetic.h @@ -236,19 +236,24 @@ struct DecimalBinaryOperation return; } } - else if constexpr(is_multiply && (!is_decimal_a || !is_decimal_b)) + else if constexpr(is_multiply && (!is_decimal_a || !is_decimal_b)) // BUG very bad solution { if (scale_a != 1) { for (size_t i = 0; i < size; ++i) - // BUG very bad solution - c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_a); + if constexpr(IsDecimalNumber) + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_a); + else + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_a); return; } else if (scale_b != 1) { for (size_t i = 0; i < size; ++i) - c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_b); + if constexpr(IsDecimalNumber) + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_b); + else + c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier(scale_b); return; }