2017-08-04 15:54:00 +00:00
|
|
|
#pragma once
|
2017-09-17 20:22:39 +00:00
|
|
|
|
2017-08-04 15:54:00 +00:00
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
class ASTSystemQuery : public IAST
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
enum class Type
|
|
|
|
{
|
2017-08-31 12:55:19 +00:00
|
|
|
UNKNOWN,
|
2017-08-04 15:54:00 +00:00
|
|
|
SHUTDOWN,
|
|
|
|
KILL,
|
|
|
|
DROP_DNS_CACHE,
|
|
|
|
DROP_MARK_CACHE,
|
|
|
|
DROP_UNCOMPRESSED_CACHE,
|
|
|
|
STOP_LISTEN_QUERIES,
|
|
|
|
START_LISTEN_QUERIES,
|
|
|
|
RESTART_REPLICAS,
|
2018-05-21 13:49:54 +00:00
|
|
|
RESTART_REPLICA,
|
2017-08-04 15:54:00 +00:00
|
|
|
SYNC_REPLICA,
|
|
|
|
RELOAD_DICTIONARY,
|
|
|
|
RELOAD_DICTIONARIES,
|
2018-03-26 14:12:07 +00:00
|
|
|
RELOAD_EMBEDDED_DICTIONARIES,
|
2018-03-13 10:41:47 +00:00
|
|
|
RELOAD_CONFIG,
|
2017-08-04 15:54:00 +00:00
|
|
|
STOP_MERGES,
|
|
|
|
START_MERGES,
|
2018-05-21 13:49:54 +00:00
|
|
|
STOP_FETCHES,
|
|
|
|
START_FETCHES,
|
|
|
|
STOP_REPLICATED_SENDS,
|
|
|
|
START_REPLICATEDS_SENDS,
|
2017-08-04 15:54:00 +00:00
|
|
|
STOP_REPLICATION_QUEUES,
|
|
|
|
START_REPLICATION_QUEUES,
|
2017-08-31 12:55:19 +00:00
|
|
|
END
|
2017-08-04 15:54:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const char * typeToString(Type type);
|
|
|
|
|
2017-08-31 12:55:19 +00:00
|
|
|
Type type = Type::UNKNOWN;
|
2017-08-04 15:54:00 +00:00
|
|
|
|
|
|
|
String target_dictionary;
|
2018-05-21 13:49:54 +00:00
|
|
|
String target_database;
|
|
|
|
String target_table;
|
2017-08-04 15:54:00 +00:00
|
|
|
|
2017-08-06 20:26:23 +00:00
|
|
|
String getID() const override { return "SYSTEM query"; };
|
2017-08-04 15:54:00 +00:00
|
|
|
|
|
|
|
ASTPtr clone() const override { return std::make_shared<ASTSystemQuery>(*this); }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
2017-08-06 20:26:23 +00:00
|
|
|
void formatImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;
|
2017-08-04 15:54:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-08-30 21:25:44 +00:00
|
|
|
}
|