This commit is contained in:
Kirill 2024-09-16 00:32:38 +02:00 committed by GitHub
commit 4ef7a51c30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -470,13 +470,15 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
}
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,
"Cannot parse number with a sign character but without any numeric character");
else
return ReturnType(false);
throw Exception(ErrorCodes::CANNOT_PARSE_NUMBER,
"Cannot parse number without any numeric character");
}
x = res;
if constexpr (is_signed_v<T>)