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