mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
fix2
This commit is contained in:
parent
fbaa8d3951
commit
a199348860
@ -292,6 +292,28 @@ struct DecimalBinaryOperation
|
||||
return;
|
||||
}
|
||||
}
|
||||
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)
|
||||
if constexpr(IsDecimalNumber<ResultType>)
|
||||
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<NativeResultType>(scale_a);
|
||||
else
|
||||
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<Int64>(scale_a);
|
||||
return;
|
||||
}
|
||||
else if (scale_b != 1)
|
||||
{
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
if constexpr(IsDecimalNumber<ResultType>)
|
||||
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<NativeResultType>(scale_b);
|
||||
else
|
||||
c[i] = apply(undec(a[i]), undec(b[i])) / DecimalUtils::scaleMultiplier<Int64>(scale_b);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if constexpr (is_division && is_decimal_b)
|
||||
{
|
||||
for (size_t i = 0; i < size; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user