mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
fix asan
This commit is contained in:
parent
4392d04837
commit
0a7e4ff3bf
@ -153,7 +153,7 @@ struct DivideDecimalsImpl
|
||||
++scale_a;
|
||||
}
|
||||
|
||||
while (scale_a > scale_b + result_scale && a_digits.size())
|
||||
while (scale_a > scale_b + result_scale && !a_digits.empty())
|
||||
{
|
||||
a_digits.pop_back();
|
||||
--scale_a;
|
||||
@ -196,12 +196,15 @@ struct MultiplyDecimalsImpl
|
||||
++product_scale;
|
||||
}
|
||||
|
||||
while (product_scale > result_scale)
|
||||
while (product_scale > result_scale&& !multiplied.empty())
|
||||
{
|
||||
multiplied.pop_back();
|
||||
--product_scale;
|
||||
}
|
||||
|
||||
if (multiplied.empty())
|
||||
return Decimal256(0);
|
||||
|
||||
if (multiplied.size() > 76)
|
||||
throw DB::Exception("Numeric overflow: result bigger that Decimal256", ErrorCodes::DECIMAL_OVERFLOW);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user