From 277759146d810796ee72acb8888c7fa5ac7ef85e Mon Sep 17 00:00:00 2001 From: Vyacheslav Alipov Date: Tue, 16 Jul 2013 15:10:37 +0000 Subject: [PATCH] identifier parser now supports '.' [#CONV-7967] --- dbms/src/Parsers/ExpressionElementParsers.cpp | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/dbms/src/Parsers/ExpressionElementParsers.cpp b/dbms/src/Parsers/ExpressionElementParsers.cpp index 3a7fbec9e42..cfc816c136e 100644 --- a/dbms/src/Parsers/ExpressionElementParsers.cpp +++ b/dbms/src/Parsers/ExpressionElementParsers.cpp @@ -136,12 +136,23 @@ bool ParserIdentifier::parseImpl(Pos & pos, Pos end, ASTPtr & node, String & exp } else { - while (pos != end - && ((*pos >= 'a' && *pos <= 'z') - || (*pos >= 'A' && *pos <= 'Z') - || (*pos == '_') - || (pos != begin && *pos >= '0' && *pos <= '9'))) - ++pos; + while (pos != end) + { + while (pos != end + && ((*pos >= 'a' && *pos <= 'z') + || (*pos >= 'A' && *pos <= 'Z') + || (*pos == '_') + || (pos != begin && *pos >= '0' && *pos <= '9'))) + ++pos; + + /// Если следующий символ - точка '.' и за ней следует, не цифра, + /// то продолжаем парсинг имени идентификатора + if (pos != begin && pos + 1 < end && *pos == '.' && + !(*(pos + 1) >= '0' && *(pos + 1) <= '9')) + ++pos; + else + break; + } if (pos != begin) {