ClickHouse/dbms/src/Parsers/ParserKillQueryQuery.cpp

39 lines
900 B
C++
Raw Normal View History

#include <Parsers/ParserKillQueryQuery.h>
#include <Parsers/ASTKillQueryQuery.h>
#include <Parsers/CommonParsers.h>
#include <Parsers/ExpressionListParsers.h>
2016-11-30 17:31:05 +00:00
namespace DB
{
bool ParserKillQueryQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
2016-11-30 17:31:05 +00:00
{
auto query = std::make_shared<ASTKillQueryQuery>();
2016-11-30 17:31:05 +00:00
if (!ParserKeyword{"KILL QUERY"}.ignore(pos, expected))
return false;
2016-11-30 17:31:05 +00:00
if (!ParserKeyword{"WHERE"}.ignore(pos, expected))
return false;
2016-11-30 17:31:05 +00:00
ParserExpression p_where_expression;
if (!p_where_expression.parse(pos, query->where_expression, expected))
return false;
2016-11-30 17:31:05 +00:00
if (ParserKeyword{"SYNC"}.ignore(pos))
query->sync = true;
else if (ParserKeyword{"ASYNC"}.ignore(pos))
query->sync = false;
else if (ParserKeyword{"TEST"}.ignore(pos))
query->test = true;
2016-11-30 17:31:05 +00:00
node = std::move(query);
2016-11-30 17:31:05 +00:00
return true;
2016-11-30 17:31:05 +00:00
}
}