mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 08:02:02 +00:00
ISSUES-14231 allow dollar and numver in identifier
This commit is contained in:
parent
592b6dcdce
commit
761512413e
@ -146,13 +146,20 @@ Token Lexer::nextTokenImpl()
|
||||
}
|
||||
}
|
||||
|
||||
/// word character cannot go just after number (SELECT 123FROM)
|
||||
/// Try to parse it to a identifier(1identifier_name), return ErrorWrongNumber if not
|
||||
if (pos < end && isWordCharASCII(*pos))
|
||||
{
|
||||
++pos;
|
||||
while (pos < end && isWordCharASCII(*pos))
|
||||
++pos;
|
||||
return Token(TokenType::ErrorWrongNumber, token_begin, pos);
|
||||
|
||||
for (const char * iterator = token_begin; iterator < pos; ++iterator)
|
||||
{
|
||||
if (!isWordCharASCII(*iterator) && *iterator != '$')
|
||||
return Token(TokenType::ErrorWrongNumber, token_begin, pos);
|
||||
}
|
||||
|
||||
return Token(TokenType::BareWord, token_begin, pos);
|
||||
}
|
||||
|
||||
return Token(TokenType::Number, token_begin, pos);
|
||||
|
@ -1,2 +1,4 @@
|
||||
$alias$name$
|
||||
1
|
||||
1alias1name1
|
||||
1
|
@ -1 +1,2 @@
|
||||
SELECT 1 AS $alias$name$ FORMAT TSVWithNames;
|
||||
SELECT 1 AS 1alias1name1 FORMAT TSVWithNames;
|
Loading…
Reference in New Issue
Block a user