2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/ASTKillQueryQuery.h>
|
2016-11-30 17:31:05 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2018-12-07 12:34:40 +00:00
|
|
|
String ASTKillQueryQuery::getID(char delim) const
|
2017-01-24 13:39:39 +00:00
|
|
|
{
|
2018-12-07 12:34:40 +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
|
|
|
|
{
|
2019-01-10 18:19:29 +00:00
|
|
|
settings.ostr << (settings.hilite ? hilite_keyword : "") << "KILL "
|
2019-02-05 13:15:11 +00:00
|
|
|
<< (type == Type::Query ? "QUERY" : "MUTATION");
|
2018-07-20 05:46:48 +00:00
|
|
|
|
|
|
|
formatOnCluster(settings);
|
2017-01-24 13:39:39 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
if (where_expression)
|
2018-12-24 11:06:35 +00:00
|
|
|
{
|
|
|
|
settings.ostr << " WHERE " << (settings.hilite ? hilite_none : "");
|
2017-04-01 07:20:54 +00:00
|
|
|
where_expression->formatImpl(settings, state, frame);
|
2018-12-24 11:06:35 +00:00
|
|
|
}
|
2017-01-24 13:39:39 +00:00
|
|
|
|
2018-03-05 14:45:19 +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
|
|
|
}
|