2011-11-05 23:31:19 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <DB/Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** DROP запрос
|
|
|
|
|
*/
|
|
|
|
|
class ASTDropQuery : public IAST
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
bool detach; /// Запрос DETACH, а не DROP.
|
|
|
|
|
bool if_exists;
|
|
|
|
|
String database;
|
|
|
|
|
String table;
|
|
|
|
|
|
|
|
|
|
ASTDropQuery() {}
|
|
|
|
|
ASTDropQuery(StringRange range_) : IAST(range_), detach(false), if_exists(false) {}
|
|
|
|
|
|
|
|
|
|
/** Получить текст, который идентифицирует этот элемент. */
|
2012-12-27 16:23:12 +00:00
|
|
|
|
String getID() const { return (detach ? "DetachQuery_" : "DropQuery_") + database + "_" + table; };
|
2011-12-12 06:15:34 +00:00
|
|
|
|
|
|
|
|
|
ASTPtr clone() const { return new ASTDropQuery(*this); }
|
2011-11-05 23:31:19 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|