Compare commits

...

2 Commits

Author SHA1 Message Date
Kirill
73203357cf
Merge d05b06fda7 into 208fd6efe1 2024-11-16 14:08:13 -08:00
Кирилл Гарбар
d05b06fda7 Fix no number case in readIntText 2024-09-13 17:19:03 +03:00

View File

@ -468,13 +468,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>)