2013-08-07 13:07:42 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Interpreters/IInterpreter.h>
|
2019-03-11 14:01:45 +00:00
|
|
|
#include <Parsers/IAST_fwd.h>
|
2017-01-21 04:24:28 +00:00
|
|
|
|
2013-08-07 13:07:42 +00:00
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2021-04-10 23:33:54 +00:00
|
|
|
|
2020-01-24 16:20:36 +00:00
|
|
|
class AccessRightsElements;
|
2020-03-06 17:13:28 +00:00
|
|
|
class ASTAlterCommand;
|
2020-01-24 16:20:36 +00:00
|
|
|
|
2018-12-25 23:11:36 +00:00
|
|
|
|
2017-06-02 21:37:28 +00:00
|
|
|
/** Allows you add or remove a column in the table.
|
|
|
|
* It also allows you to manipulate the partitions of the MergeTree family tables.
|
2013-08-07 13:07:42 +00:00
|
|
|
*/
|
2021-04-10 23:33:54 +00:00
|
|
|
class InterpreterAlterQuery : public IInterpreter, WithContext
|
2013-08-07 13:07:42 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-04-10 23:33:54 +00:00
|
|
|
InterpreterAlterQuery(const ASTPtr & query_ptr_, ContextPtr context_);
|
2013-08-07 13:07:42 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
BlockIO execute() override;
|
2013-08-07 13:07:42 +00:00
|
|
|
|
2020-03-06 17:13:28 +00:00
|
|
|
static AccessRightsElements getRequiredAccessForCommand(const ASTAlterCommand & command, const String & database, const String & table);
|
|
|
|
|
2021-04-10 23:33:54 +00:00
|
|
|
void extendQueryLogElemImpl(QueryLogElement & elem, const ASTPtr & ast, ContextPtr context) const override;
|
2020-12-14 03:30:39 +00:00
|
|
|
|
2014-07-11 08:12:03 +00:00
|
|
|
private:
|
2020-01-24 16:20:36 +00:00
|
|
|
AccessRightsElements getRequiredAccess() const;
|
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
ASTPtr query_ptr;
|
2013-08-07 13:07:42 +00:00
|
|
|
};
|
2014-10-16 13:37:01 +00:00
|
|
|
|
2013-08-07 13:07:42 +00:00
|
|
|
}
|