mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
fix parser
This commit is contained in:
parent
ebb19cd9b5
commit
0f1cf3a3b8
@ -313,11 +313,20 @@ bool ParserAlterSettingsProfileElements::parseImpl(Pos & pos, ASTPtr & node, Exp
|
|||||||
auto parse_element = [&]
|
auto parse_element = [&]
|
||||||
{
|
{
|
||||||
if (ParserKeyword{Keyword::ADD}.ignore(pos, expected))
|
if (ParserKeyword{Keyword::ADD}.ignore(pos, expected))
|
||||||
|
{
|
||||||
action = "ADD";
|
action = "ADD";
|
||||||
|
target = "";
|
||||||
|
}
|
||||||
else if (ParserKeyword{Keyword::DROP}.ignore(pos, expected))
|
else if (ParserKeyword{Keyword::DROP}.ignore(pos, expected))
|
||||||
|
{
|
||||||
action = "DROP";
|
action = "DROP";
|
||||||
|
target = "";
|
||||||
|
}
|
||||||
else if (ParserKeyword{Keyword::MODIFY}.ignore(pos, expected))
|
else if (ParserKeyword{Keyword::MODIFY}.ignore(pos, expected))
|
||||||
|
{
|
||||||
action = "MODIFY";
|
action = "MODIFY";
|
||||||
|
target = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (!action.empty())
|
if (!action.empty())
|
||||||
{
|
{
|
||||||
@ -329,10 +338,11 @@ bool ParserAlterSettingsProfileElements::parseImpl(Pos & pos, ASTPtr & node, Exp
|
|||||||
target = "PROFILES";
|
target = "PROFILES";
|
||||||
else if (ParserKeyword{Keyword::SETTINGS}.ignore(pos, expected) || ParserKeyword{Keyword::SETTING}.ignore(pos, expected))
|
else if (ParserKeyword{Keyword::SETTINGS}.ignore(pos, expected) || ParserKeyword{Keyword::SETTING}.ignore(pos, expected))
|
||||||
target = "SETTINGS";
|
target = "SETTINGS";
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target.empty())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (target == "PROFILES")
|
if (target == "PROFILES")
|
||||||
{
|
{
|
||||||
auto element = std::make_shared<ASTSettingsProfileElement>();
|
auto element = std::make_shared<ASTSettingsProfileElement>();
|
||||||
|
Loading…
Reference in New Issue
Block a user