ISSUES-4006 fix test failure

This commit is contained in:
zhang2014 2020-07-14 11:05:17 +08:00
parent f5b66810ce
commit eace0153bd
3 changed files with 4 additions and 2 deletions

View File

@ -133,7 +133,8 @@ DatabasePtr DatabaseFactory::getImpl(const ASTCreateQuery & create, const String
, std::move(materialize_mode_settings)); , std::move(materialize_mode_settings));
} }
return std::make_shared<DatabaseConnectionMySQL>(context, database_name, metadata_path, engine_define, mysql_database_name, std::move(mysql_pool)); return std::make_shared<DatabaseConnectionMySQL>(
context, database_name, metadata_path, engine_define, mysql_database_name, std::move(mysql_pool));
} }
catch (...) catch (...)
{ {

View File

@ -71,6 +71,7 @@ DatabaseConnectionMySQL::DatabaseConnectionMySQL(
, mysql_pool(std::move(pool)) , mysql_pool(std::move(pool))
{ {
empty(); /// test database is works fine. empty(); /// test database is works fine.
thread = ThreadFromGlobalPool{&DatabaseConnectionMySQL::cleanOutdatedTables, this};
} }
bool DatabaseConnectionMySQL::empty() const bool DatabaseConnectionMySQL::empty() const

View File

@ -91,7 +91,7 @@ private:
void fetchLatestTablesStructureIntoCache(const std::map<String, UInt64> & tables_modification_time) const; void fetchLatestTablesStructureIntoCache(const std::map<String, UInt64> & tables_modification_time) const;
ThreadFromGlobalPool thread{&DatabaseConnectionMySQL::cleanOutdatedTables, this}; ThreadFromGlobalPool thread;
}; };
} }