Fix compile error

This commit is contained in:
spongedc 2020-12-16 12:07:50 +08:00
parent 81b0fa2989
commit a0083e23d6
5 changed files with 6 additions and 6 deletions

View File

@ -111,7 +111,7 @@ String getObjectDefinitionFromCreateQuery(const ASTPtr & query)
create->replace_view = false; create->replace_view = false;
/// For views it is necessary to save the SELECT query itself, for the rest - on the contrary /// For views it is necessary to save the SELECT query itself, for the rest - on the contrary
if (!create->is_view && !create->is_materialized_view && !create->is_live_view) if (!create->isView())
create->select = nullptr; create->select = nullptr;
create->format = nullptr; create->format = nullptr;

View File

@ -624,7 +624,7 @@ void InterpreterCreateQuery::setEngine(ASTCreateQuery & create) const
const String qualified_name = backQuoteIfNeed(as_database_name) + "." + backQuoteIfNeed(as_table_name); const String qualified_name = backQuoteIfNeed(as_database_name) + "." + backQuoteIfNeed(as_table_name);
if (as_create.is_view) if (as_create.is_ordinary_view)
throw Exception( throw Exception(
"Cannot CREATE a table AS " + qualified_name + ", it is a View", "Cannot CREATE a table AS " + qualified_name + ", it is a View",
ErrorCodes::INCORRECT_QUERY); ErrorCodes::INCORRECT_QUERY);
@ -1030,7 +1030,7 @@ AccessRightsElements InterpreterCreateQuery::getRequiredAccess() const
{ {
required_access.emplace_back(AccessType::CREATE_DICTIONARY, create.database, create.table); required_access.emplace_back(AccessType::CREATE_DICTIONARY, create.database, create.table);
} }
else if (create.is_view || create.is_materialized_view || create.is_live_view) else if (create.isView())
{ {
if (create.temporary) if (create.temporary)
required_access.emplace_back(AccessType::CREATE_TEMPORARY_TABLE); required_access.emplace_back(AccessType::CREATE_TEMPORARY_TABLE);

View File

@ -231,7 +231,7 @@ void ASTCreateQuery::formatQueryImpl(const FormatSettings & settings, FormatStat
if (!is_dictionary) if (!is_dictionary)
{ {
std::string what = "TABLE"; std::string what = "TABLE";
if (is_view) if (is_ordinary_view)
what = "VIEW"; what = "VIEW";
if (is_materialized_view) if (is_materialized_view)
what = "MATERIALIZED VIEW"; what = "MATERIALIZED VIEW";

View File

@ -91,7 +91,7 @@ public:
return removeOnCluster<ASTCreateQuery>(clone(), new_database); return removeOnCluster<ASTCreateQuery>(clone(), new_database);
} }
bool isView() { return is_view || is_materialized_view || is_live_view; } bool isView() const { return is_ordinary_view || is_materialized_view || is_live_view; }
protected: protected:
void formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override; void formatQueryImpl(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const override;

View File

@ -35,7 +35,7 @@ ASTPtr CreateViewQuery::convertToOld() const
query->attach = attach; query->attach = attach;
query->replace_view = replace; query->replace_view = replace;
query->if_not_exists = if_not_exists; query->if_not_exists = if_not_exists;
query->is_view = true; query->is_ordinary_view = true;
query->cluster = cluster_name; query->cluster = cluster_name;
if (has(SCHEMA)) query->set(query->columns_list, get(SCHEMA)->convertToOld()); if (has(SCHEMA)) query->set(query->columns_list, get(SCHEMA)->convertToOld());