From 0dd88a1b033c7069bbaee06122f23f19038aa6ae Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 16 Jun 2019 02:44:51 +0300 Subject: [PATCH] Fixed build --- dbms/src/Databases/DatabaseMySQL.cpp | 5 +++-- dbms/src/Databases/DatabaseMySQL.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dbms/src/Databases/DatabaseMySQL.cpp b/dbms/src/Databases/DatabaseMySQL.cpp index f5b2e2aec19..3b415e66f93 100644 --- a/dbms/src/Databases/DatabaseMySQL.cpp +++ b/dbms/src/Databases/DatabaseMySQL.cpp @@ -65,7 +65,7 @@ bool DatabaseMySQL::empty(const Context &) const return local_tables_cache.empty(); } -DatabaseIteratorPtr DatabaseMySQL::getIterator(const Context &) +DatabaseIteratorPtr DatabaseMySQL::getIterator(const Context &, const FilterByNameFunction & filter_by_table_name) { Tables tables; std::lock_guard lock(mutex); @@ -73,7 +73,8 @@ DatabaseIteratorPtr DatabaseMySQL::getIterator(const Context &) fetchTablesIntoLocalCache(); for (const auto & local_table : local_tables_cache) - tables[local_table.first] = local_table.second.storage; + if (!filter_by_table_name || filter_by_table_name(local_table.first)) + tables[local_table.first] = local_table.second.storage; return std::make_unique(tables); } diff --git a/dbms/src/Databases/DatabaseMySQL.h b/dbms/src/Databases/DatabaseMySQL.h index 3e89b395208..483429bc03f 100644 --- a/dbms/src/Databases/DatabaseMySQL.h +++ b/dbms/src/Databases/DatabaseMySQL.h @@ -28,7 +28,7 @@ public: bool empty(const Context & context) const override; - DatabaseIteratorPtr getIterator(const Context & context) override; + DatabaseIteratorPtr getIterator(const Context & context, const FilterByNameFunction & filter_by_table_name = {}) override; ASTPtr getCreateDatabaseQuery(const Context & context) const override;