2012-06-18 06:19:13 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/Parsers/IAST.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/** RENAME запрос
|
|
|
|
*/
|
|
|
|
class ASTRenameQuery : public IAST
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
struct Table
|
|
|
|
{
|
|
|
|
String database;
|
|
|
|
String table;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Element
|
|
|
|
{
|
|
|
|
Table from;
|
|
|
|
Table to;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<Element> Elements;
|
|
|
|
Elements elements;
|
|
|
|
|
|
|
|
ASTRenameQuery() {}
|
|
|
|
ASTRenameQuery(StringRange range_) : IAST(range_) {}
|
|
|
|
|
|
|
|
/** Получить текст, который идентифицирует этот элемент. */
|
2012-12-27 16:23:12 +00:00
|
|
|
String getID() const { return "Rename"; };
|
2012-06-18 06:19:13 +00:00
|
|
|
|
|
|
|
ASTPtr clone() const { return new ASTRenameQuery(*this); }
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|