diff --git a/src/Parsers/Access/ParserGrantQuery.cpp b/src/Parsers/Access/ParserGrantQuery.cpp index 863c5435352..cd24dc610ed 100644 --- a/src/Parsers/Access/ParserGrantQuery.cpp +++ b/src/Parsers/Access/ParserGrantQuery.cpp @@ -288,7 +288,16 @@ bool ParserGrantQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) if (!is_revoke && ParserKeyword{"CURRENT GRANTS"}.ignore(pos, expected)) { current_grants = true; - elements.emplace_back(AccessType::ALL); + if (ParserToken(TokenType::OpeningRoundBracket).ignore(pos, expected)) + { + if (!parseElementsWithoutOptions(pos, expected, elements) && !parseRoles(pos, expected, is_revoke, attach_mode, roles)) + return false; + + if (!ParserToken(TokenType::ClosingRoundBracket).ignore(pos, expected)) + return false; + } + else + elements.emplace_back(AccessType::ALL); } else {