提交 a74b5740 编写于 作者: A Alexey Milovidov

dbms: fixed infinite loop while trying to print minimal negative number with...

dbms: fixed infinite loop while trying to print minimal negative number with Pretty format [#CONV-2944].

上级 dec7aaf6
...@@ -60,6 +60,8 @@ static void numWidthConstant(T a, UInt64 & c) ...@@ -60,6 +60,8 @@ static void numWidthConstant(T a, UInt64 & c)
{ {
if (a >= 0) if (a >= 0)
c = a ? 1 + log10(a) : 1; c = a ? 1 + log10(a) : 1;
else if (std::tr1::is_signed<T>::value && a == std::numeric_limits<T>::min())
c = 2 + log10(std::numeric_limits<T>::max());
else else
c = 2 + log10(-a); c = 2 + log10(-a);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册