2018-02-02 16:02:43 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2018-05-15 12:56:14 +00:00
|
|
|
class IStorage;
|
|
|
|
class Context;
|
|
|
|
|
2018-02-02 16:02:43 +00:00
|
|
|
struct MutationCommand
|
|
|
|
{
|
|
|
|
enum Type
|
|
|
|
{
|
|
|
|
EMPTY, /// Not used.
|
|
|
|
DELETE,
|
|
|
|
};
|
|
|
|
|
|
|
|
Type type = EMPTY;
|
|
|
|
|
|
|
|
ASTPtr predicate;
|
|
|
|
|
|
|
|
static MutationCommand delete_(const ASTPtr & predicate)
|
|
|
|
{
|
|
|
|
MutationCommand res;
|
|
|
|
res.type = DELETE;
|
|
|
|
res.predicate = predicate;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MutationCommands
|
|
|
|
{
|
|
|
|
std::vector<MutationCommand> commands;
|
2018-05-15 12:56:14 +00:00
|
|
|
|
|
|
|
void validate(const IStorage & table, const Context & context);
|
2018-02-02 16:02:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|