Fix DROP MV with max_table_size_to_drop. [#CLICKHOUSE-3]

Resolves #1863
This commit is contained in:
Vitaliy Lyudvichenko 2018-02-12 22:26:16 +03:00 committed by alexey-milovidov
parent 56add902d4
commit d5fd8b9b5f
2 changed files with 7 additions and 0 deletions

View File

@ -190,6 +190,12 @@ StoragePtr StorageMaterializedView::getTargetTable() const
return global_context.getTable(target_database_name, target_table_name);
}
bool StorageMaterializedView::checkTableCanBeDropped() const
{
/// Don't drop the target table if it was created manually via 'TO inner_table' statement
return has_inner_table ? getTargetTable()->checkTableCanBeDropped() : true;
}
void registerStorageMaterializedView(StorageFactory & factory)
{

View File

@ -33,6 +33,7 @@ public:
void drop() override;
bool optimize(const ASTPtr & query, const ASTPtr & partition, bool final, bool deduplicate, const Context & context) override;
void shutdown() override;
bool checkTableCanBeDropped() const override;
BlockInputStreams read(
const Names & column_names,