From 18ed0b2829c73d9e7a31639088bbe7ac5c40cedd Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 12 Aug 2015 07:21:10 +0300 Subject: [PATCH] dbms: external dictionaries: fixed errors [#METR-17508]. --- dbms/include/DB/Dictionaries/CacheDictionary.h | 6 +++--- dbms/include/DB/Dictionaries/FlatDictionary.h | 2 +- dbms/include/DB/Dictionaries/HashedDictionary.h | 2 +- dbms/include/DB/Dictionaries/RangeHashedDictionary.h | 2 +- dbms/src/Interpreters/ExternalDictionaries.cpp | 2 +- libs/libmysqlxx/src/PoolWithFailover.cpp | 4 +--- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dbms/include/DB/Dictionaries/CacheDictionary.h b/dbms/include/DB/Dictionaries/CacheDictionary.h index 07db7c0dda2..15bbe05cb19 100644 --- a/dbms/include/DB/Dictionaries/CacheDictionary.h +++ b/dbms/include/DB/Dictionaries/CacheDictionary.h @@ -620,9 +620,9 @@ private: mutable std::mt19937_64 rnd_engine{getSeed()}; mutable std::size_t bytes_allocated = 0; - mutable std::atomic element_count{}; - mutable std::atomic hit_count{}; - mutable std::atomic query_count{}; + mutable std::atomic element_count{0}; + mutable std::atomic hit_count{0}; + mutable std::atomic query_count{0}; const std::chrono::time_point creation_time = std::chrono::system_clock::now(); }; diff --git a/dbms/include/DB/Dictionaries/FlatDictionary.h b/dbms/include/DB/Dictionaries/FlatDictionary.h index b1267bc618f..0c1c2fb33e5 100644 --- a/dbms/include/DB/Dictionaries/FlatDictionary.h +++ b/dbms/include/DB/Dictionaries/FlatDictionary.h @@ -361,7 +361,7 @@ private: std::size_t bytes_allocated = 0; std::size_t element_count = 0; std::size_t bucket_count = 0; - mutable std::atomic query_count; + mutable std::atomic query_count{0}; std::chrono::time_point creation_time; diff --git a/dbms/include/DB/Dictionaries/HashedDictionary.h b/dbms/include/DB/Dictionaries/HashedDictionary.h index e356808fec5..a73f8869f81 100644 --- a/dbms/include/DB/Dictionaries/HashedDictionary.h +++ b/dbms/include/DB/Dictionaries/HashedDictionary.h @@ -347,7 +347,7 @@ private: std::size_t bytes_allocated = 0; std::size_t element_count = 0; std::size_t bucket_count = 0; - mutable std::atomic query_count{}; + mutable std::atomic query_count{0}; std::chrono::time_point creation_time; diff --git a/dbms/include/DB/Dictionaries/RangeHashedDictionary.h b/dbms/include/DB/Dictionaries/RangeHashedDictionary.h index a00208c5b48..888173b8940 100644 --- a/dbms/include/DB/Dictionaries/RangeHashedDictionary.h +++ b/dbms/include/DB/Dictionaries/RangeHashedDictionary.h @@ -422,7 +422,7 @@ private: std::size_t bytes_allocated = 0; std::size_t element_count = 0; std::size_t bucket_count = 0; - mutable std::atomic query_count{}; + mutable std::atomic query_count{0}; std::chrono::time_point creation_time; diff --git a/dbms/src/Interpreters/ExternalDictionaries.cpp b/dbms/src/Interpreters/ExternalDictionaries.cpp index 4a84afa97d1..0e4525efb9a 100644 --- a/dbms/src/Interpreters/ExternalDictionaries.cpp +++ b/dbms/src/Interpreters/ExternalDictionaries.cpp @@ -161,7 +161,7 @@ void ExternalDictionaries::reloadImpl(const bool throw_on_error) { dictionary.second.exception = std::current_exception(); - tryLogCurrentException(log, "Cannot update external dictionary '" + name + "', leaving old version."); + tryLogCurrentException(log, "Cannot update external dictionary '" + name + "', leaving old version"); } } } diff --git a/libs/libmysqlxx/src/PoolWithFailover.cpp b/libs/libmysqlxx/src/PoolWithFailover.cpp index c98b42036d2..5fe4c64dfdf 100644 --- a/libs/libmysqlxx/src/PoolWithFailover.cpp +++ b/libs/libmysqlxx/src/PoolWithFailover.cpp @@ -13,10 +13,8 @@ PoolWithFailover::PoolWithFailover(const Poco::Util::AbstractConfiguration & cfg cfg.keys(config_name, replica_keys); for (Poco::Util::AbstractConfiguration::Keys::const_iterator it = replica_keys.begin(); it != replica_keys.end(); ++it) { - if (!(*it == "port" || *it == "user" || *it == "password" || *it == "db" || *it == "table")) + if (*it == "replica") /// На том же уровне могут быть другие параметры. { - if (it->size() < std::string("replica").size() || it->substr(0, std::string("replica").size()) != "replica") - throw Poco::Exception("Unknown element in config: " + *it + ", expected replica"); std::string replica_name = config_name + "." + *it; Replica replica(new Pool(cfg, replica_name, default_connections, max_connections, config_name.c_str()), cfg.getInt(replica_name + ".priority", 0));