diff --git a/dbms/src/Parsers/ExpressionElementParsers.cpp b/dbms/src/Parsers/ExpressionElementParsers.cpp index e2e77a6c00d..e87332f33f8 100644 --- a/dbms/src/Parsers/ExpressionElementParsers.cpp +++ b/dbms/src/Parsers/ExpressionElementParsers.cpp @@ -137,12 +137,16 @@ bool ParserIdentifier::parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_pa { Pos begin = pos; - /// Identifier in backquotes - if (pos != end && *pos == '`') + /// Identifier in backquotes or in double quotes + if (pos != end && (*pos == '`' || *pos == '"')) { ReadBufferFromMemory buf(pos, end - pos); String s; - readBackQuotedString(s, buf); + + if (*pos == '`') + readBackQuotedString(s, buf); + else + readDoubleQuotedString(s, buf); if (s.empty()) /// Identifiers "empty string" are not allowed. return false; diff --git a/dbms/tests/queries/0_stateless/00470_identifiers_in_double_quotes.reference b/dbms/tests/queries/0_stateless/00470_identifiers_in_double_quotes.reference new file mode 100644 index 00000000000..573541ac970 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00470_identifiers_in_double_quotes.reference @@ -0,0 +1 @@ +0 diff --git a/dbms/tests/queries/0_stateless/00470_identifiers_in_double_quotes.sql b/dbms/tests/queries/0_stateless/00470_identifiers_in_double_quotes.sql new file mode 100644 index 00000000000..ec00c5a43ed --- /dev/null +++ b/dbms/tests/queries/0_stateless/00470_identifiers_in_double_quotes.sql @@ -0,0 +1 @@ +SELECT "numbers"."number" FROM "system"."numbers" LIMIT 1;