ClickHouse/src/Parsers/ASTKillQueryQuery.cpp

28 lines
880 B
C++
Raw Normal View History

#include <Parsers/ASTKillQueryQuery.h>
2016-11-30 17:31:05 +00:00
namespace DB
{
String ASTKillQueryQuery::getID(char delim) const
2017-01-24 13:39:39 +00:00
{
return String("KillQueryQuery") + delim + (where_expression ? where_expression->getID() : "") + delim + String(sync ? "SYNC" : "ASYNC");
2017-01-24 13:39:39 +00:00
}
void ASTKillQueryQuery::formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const
{
settings.ostr << (settings.hilite ? hilite_keyword : "") << "KILL "
<< (type == Type::Query ? "QUERY" : "MUTATION");
formatOnCluster(settings);
2017-01-24 13:39:39 +00:00
if (where_expression)
2018-12-24 11:06:35 +00:00
{
settings.ostr << " WHERE " << (settings.hilite ? hilite_none : "");
where_expression->formatImpl(settings, state, frame);
2018-12-24 11:06:35 +00:00
}
2017-01-24 13:39:39 +00:00
settings.ostr << " " << (settings.hilite ? hilite_keyword : "") << (test ? "TEST" : (sync ? "SYNC" : "ASYNC")) << (settings.hilite ? hilite_none : "");
2017-01-24 13:39:39 +00:00
}
2016-11-30 17:31:05 +00:00
}