2012-06-18 07:49:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <DB/Parsers/IAST.h>
|
2013-02-20 13:14:12 +00:00
|
|
|
#include <DB/Parsers/ASTQueryWithOutput.h>
|
2012-06-18 07:49:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/** Запрос SHOW TABLES или SHOW DATABASES
|
|
|
|
*/
|
2013-02-20 13:14:12 +00:00
|
|
|
class ASTShowTablesQuery : public ASTQueryWithOutput
|
2012-06-18 07:49:19 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool databases;
|
|
|
|
String from;
|
|
|
|
String like;
|
2013-03-11 11:28:36 +00:00
|
|
|
bool not_like;
|
2012-06-18 07:49:19 +00:00
|
|
|
|
2013-03-11 11:28:36 +00:00
|
|
|
ASTShowTablesQuery() : databases(false), not_like(false) {}
|
|
|
|
ASTShowTablesQuery(StringRange range_) : ASTQueryWithOutput(range_), databases(false), not_like(false) {}
|
2012-06-18 07:49:19 +00:00
|
|
|
|
|
|
|
/** Получить текст, который идентифицирует этот элемент. */
|
2012-12-27 16:23:12 +00:00
|
|
|
String getID() const { return "ShowTables"; };
|
2012-06-18 07:49:19 +00:00
|
|
|
|
2013-02-20 13:14:12 +00:00
|
|
|
ASTPtr clone() const
|
|
|
|
{
|
|
|
|
ASTShowTablesQuery * res = new ASTShowTablesQuery(*this);
|
|
|
|
res->children.clear();
|
|
|
|
|
|
|
|
if (format)
|
|
|
|
{
|
|
|
|
res->format = format->clone();
|
|
|
|
res->children.push_back(res->format);
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
2012-06-18 07:49:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|