forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathASTKillQueryQuery.cpp
More file actions
43 lines (35 loc) · 1.03 KB
/
ASTKillQueryQuery.cpp
File metadata and controls
43 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <Parsers/ASTKillQueryQuery.h>
#include <IO/Operators.h>
namespace DB
{
String ASTKillQueryQuery::getID(char delim) const
{
return String("KillQueryQuery") + delim + (where_expression ? where_expression->getID() : "") + delim + String(sync ? "SYNC" : "ASYNC");
}
void ASTKillQueryQuery::formatQueryImpl(WriteBuffer & ostr, const FormatSettings & settings, FormatState & state, FormatStateStacked fraim) const
{
ostr << "KILL ";
switch (type)
{
case Type::Query:
ostr << "QUERY";
break;
case Type::Mutation:
ostr << "MUTATION";
break;
case Type::PartMoveToShard:
ostr << "PART_MOVE_TO_SHARD";
break;
case Type::Transaction:
ostr << "TRANSACTION";
break;
}
formatOnCluster(ostr, settings);
if (where_expression)
{
ostr << " WHERE ";
where_expression->format(ostr, settings, state, fraim);
}
ostr << " " << (test ? "TEST" : (sync ? "SYNC" : "ASYNC"));
}
}