From 7159c572807f25eb50c3894323365ab96969df1b Mon Sep 17 00:00:00 2001 From: Andrey Mironov Date: Mon, 23 Nov 2015 22:08:57 +0300 Subject: [PATCH] dbms: fix error with ternary operator having priority lower than binary + [#METR-17328] --- .../DB/Dictionaries/ComplexKeyCacheDictionary.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dbms/include/DB/Dictionaries/ComplexKeyCacheDictionary.h b/dbms/include/DB/Dictionaries/ComplexKeyCacheDictionary.h index cd8705dd1bb..22b16d47c69 100644 --- a/dbms/include/DB/Dictionaries/ComplexKeyCacheDictionary.h +++ b/dbms/include/DB/Dictionaries/ComplexKeyCacheDictionary.h @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -20,7 +21,6 @@ #include #include #include -#include namespace DB @@ -58,7 +58,7 @@ public: std::size_t getBytesAllocated() const override { - return bytes_allocated + key_size_is_fixed ? fixed_size_keys_pool->size() : keys_pool->size(); + return bytes_allocated + (key_size_is_fixed ? fixed_size_keys_pool->size() : keys_pool->size()); } std::size_t getQueryCount() const override { return query_count.load(std::memory_order_relaxed); } @@ -553,7 +553,7 @@ private: outdated_keys[key].push_back(row); else { - const auto string_ref = cell.isDefault() ? get_default(row) : attribute_array[cell_idx]; + const auto string_ref = cell.isDefault() ? get_default(row) : attribute_array[cell_idx]; map[key] = String{string_ref}; total_length += string_ref.size + 1; } @@ -601,9 +601,9 @@ private: auto stream = source_ptr->loadKeys(in_key_columns, in_requested_rows); stream->readPrefix(); - MapType remaining_keys{in_requested_rows.size()}; + MapType remaining_keys{in_requested_rows.size()}; for (const auto row : in_requested_rows) - remaining_keys.insert({ in_keys[row], 0 }); + remaining_keys.insert({ in_keys[row], false }); std::uniform_int_distribution distribution{ dict_lifetime.min_sec, @@ -676,7 +676,7 @@ private: /// inform caller on_cell_updated(key, cell_idx); /// mark corresponding id as found - remaining_keys[key] = 1; + remaining_keys[key] = true; } }