mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 10:52:30 +00:00
dumb fix
This commit is contained in:
parent
3fb3015375
commit
5ff77e3b5f
@ -292,7 +292,11 @@ inline auto binaryOpResult(const DecimalType<T> & tx, const DecimalType<U> & ty)
|
|||||||
if constexpr (is_multiply)
|
if constexpr (is_multiply)
|
||||||
scale = tx.getScale() + ty.getScale();
|
scale = tx.getScale() + ty.getScale();
|
||||||
else if constexpr (is_division)
|
else if constexpr (is_division)
|
||||||
|
{
|
||||||
scale = tx.getScale();
|
scale = tx.getScale();
|
||||||
|
if (scale * 2 > max_precision<T>)
|
||||||
|
throw Exception("Overflow during decimal division", ErrorCodes::DECIMAL_OVERFLOW);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
scale = (tx.getScale() > ty.getScale() ? tx.getScale() : ty.getScale());
|
scale = (tx.getScale() > ty.getScale() ? tx.getScale() : ty.getScale());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user