From 0f1cf3a3b8157f44f27be4144b866972df10e988 Mon Sep 17 00:00:00 2001 From: pufit Date: Wed, 20 Nov 2024 01:37:54 -0500 Subject: [PATCH] fix parser --- .../Access/ParserSettingsProfileElement.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Parsers/Access/ParserSettingsProfileElement.cpp b/src/Parsers/Access/ParserSettingsProfileElement.cpp index 99c26d5d766..f76b171aad7 100644 --- a/src/Parsers/Access/ParserSettingsProfileElement.cpp +++ b/src/Parsers/Access/ParserSettingsProfileElement.cpp @@ -313,11 +313,20 @@ bool ParserAlterSettingsProfileElements::parseImpl(Pos & pos, ASTPtr & node, Exp auto parse_element = [&] { if (ParserKeyword{Keyword::ADD}.ignore(pos, expected)) + { action = "ADD"; + target = ""; + } else if (ParserKeyword{Keyword::DROP}.ignore(pos, expected)) + { action = "DROP"; + target = ""; + } else if (ParserKeyword{Keyword::MODIFY}.ignore(pos, expected)) + { action = "MODIFY"; + target = ""; + } if (!action.empty()) { @@ -329,10 +338,11 @@ bool ParserAlterSettingsProfileElements::parseImpl(Pos & pos, ASTPtr & node, Exp target = "PROFILES"; else if (ParserKeyword{Keyword::SETTINGS}.ignore(pos, expected) || ParserKeyword{Keyword::SETTING}.ignore(pos, expected)) target = "SETTINGS"; - else - return false; } + if (target.empty()) + return false; + if (target == "PROFILES") { auto element = std::make_shared();