mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Fix no number case in readIntText
This commit is contained in:
parent
54f0a8c0e2
commit
d05b06fda7
@ -470,13 +470,15 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (has_sign && !has_number)
|
if (!has_number)
|
||||||
{
|
{
|
||||||
if constexpr (throw_exception)
|
if constexpr (!throw_exception)
|
||||||
|
return ReturnType(false);
|
||||||
|
if (has_sign)
|
||||||
throw Exception(ErrorCodes::CANNOT_PARSE_NUMBER,
|
throw Exception(ErrorCodes::CANNOT_PARSE_NUMBER,
|
||||||
"Cannot parse number with a sign character but without any numeric character");
|
"Cannot parse number with a sign character but without any numeric character");
|
||||||
else
|
throw Exception(ErrorCodes::CANNOT_PARSE_NUMBER,
|
||||||
return ReturnType(false);
|
"Cannot parse number without any numeric character");
|
||||||
}
|
}
|
||||||
x = res;
|
x = res;
|
||||||
if constexpr (is_signed_v<T>)
|
if constexpr (is_signed_v<T>)
|
||||||
|
Loading…
Reference in New Issue
Block a user