From eace0153bd3e5ee981457000192b5cec1d6cfffe Mon Sep 17 00:00:00 2001 From: zhang2014 Date: Tue, 14 Jul 2020 11:05:17 +0800 Subject: [PATCH] ISSUES-4006 fix test failure --- src/Databases/DatabaseFactory.cpp | 3 ++- src/Databases/MySQL/DatabaseConnectionMySQL.cpp | 1 + src/Databases/MySQL/DatabaseConnectionMySQL.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Databases/DatabaseFactory.cpp b/src/Databases/DatabaseFactory.cpp index 6017b95e123..17dc2eeb804 100644 --- a/src/Databases/DatabaseFactory.cpp +++ b/src/Databases/DatabaseFactory.cpp @@ -133,7 +133,8 @@ DatabasePtr DatabaseFactory::getImpl(const ASTCreateQuery & create, const String , std::move(materialize_mode_settings)); } - return std::make_shared(context, database_name, metadata_path, engine_define, mysql_database_name, std::move(mysql_pool)); + return std::make_shared( + context, database_name, metadata_path, engine_define, mysql_database_name, std::move(mysql_pool)); } catch (...) { diff --git a/src/Databases/MySQL/DatabaseConnectionMySQL.cpp b/src/Databases/MySQL/DatabaseConnectionMySQL.cpp index 3b6b0e10b4c..48c52773216 100644 --- a/src/Databases/MySQL/DatabaseConnectionMySQL.cpp +++ b/src/Databases/MySQL/DatabaseConnectionMySQL.cpp @@ -71,6 +71,7 @@ DatabaseConnectionMySQL::DatabaseConnectionMySQL( , mysql_pool(std::move(pool)) { empty(); /// test database is works fine. + thread = ThreadFromGlobalPool{&DatabaseConnectionMySQL::cleanOutdatedTables, this}; } bool DatabaseConnectionMySQL::empty() const diff --git a/src/Databases/MySQL/DatabaseConnectionMySQL.h b/src/Databases/MySQL/DatabaseConnectionMySQL.h index ba50facc81a..49c2c65bfa4 100644 --- a/src/Databases/MySQL/DatabaseConnectionMySQL.h +++ b/src/Databases/MySQL/DatabaseConnectionMySQL.h @@ -91,7 +91,7 @@ private: void fetchLatestTablesStructureIntoCache(const std::map & tables_modification_time) const; - ThreadFromGlobalPool thread{&DatabaseConnectionMySQL::cleanOutdatedTables, this}; + ThreadFromGlobalPool thread; }; }