mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
Fix test
This commit is contained in:
parent
9939e7c1eb
commit
0ad20e6613
@ -276,11 +276,13 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
|
||||
{
|
||||
case '+':
|
||||
{
|
||||
/// 123+ or +123+, just stop after 123 or +123.
|
||||
if (has_number)
|
||||
return ReturnType(true);
|
||||
|
||||
/// No digits read yet, but we already read sign, like ++, -+.
|
||||
if (has_sign)
|
||||
{
|
||||
if (has_number)
|
||||
return ReturnType(true);
|
||||
|
||||
if constexpr (throw_exception)
|
||||
throw ParsingException(
|
||||
"Cannot parse number with multiple sign (+/-) characters",
|
||||
@ -294,11 +296,11 @@ ReturnType readIntTextImpl(T & x, ReadBuffer & buf)
|
||||
}
|
||||
case '-':
|
||||
{
|
||||
if (has_number)
|
||||
return ReturnType(true);
|
||||
|
||||
if (has_sign)
|
||||
{
|
||||
if (has_number)
|
||||
return ReturnType(true);
|
||||
|
||||
if constexpr (throw_exception)
|
||||
throw ParsingException(
|
||||
"Cannot parse number with multiple sign (+/-) characters",
|
||||
|
@ -3,8 +3,8 @@ select toInt64('+-1'); -- { serverError 72; }
|
||||
select toInt64('++1'); -- { serverError 72; }
|
||||
select toInt64('++'); -- { serverError 72; }
|
||||
select toInt64('+'); -- { serverError 72; }
|
||||
select toInt64('1+1'); -- { serverError 72; }
|
||||
select toInt64('1-1'); -- { serverError 72; }
|
||||
select toInt64('1+1'); -- { serverError 6; }
|
||||
select toInt64('1-1'); -- { serverError 6; }
|
||||
select toInt64(''); -- { serverError 32; }
|
||||
select toInt64('1');
|
||||
select toInt64('-1');
|
||||
|
Loading…
Reference in New Issue
Block a user