From d5caf72ca7edbdd3d54546c9d0faef7aa7f7e926 Mon Sep 17 00:00:00 2001 From: Andrey Mironov Date: Fri, 9 Oct 2015 17:52:45 +0300 Subject: [PATCH] Merge --- dbms/include/DB/Storages/MergeTree/MergeTreeWhereOptimizer.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dbms/include/DB/Storages/MergeTree/MergeTreeWhereOptimizer.h b/dbms/include/DB/Storages/MergeTree/MergeTreeWhereOptimizer.h index 165ea34b61b..45946c2eaba 100644 --- a/dbms/include/DB/Storages/MergeTree/MergeTreeWhereOptimizer.h +++ b/dbms/include/DB/Storages/MergeTree/MergeTreeWhereOptimizer.h @@ -225,6 +225,11 @@ private: std::size_t getIdentifiersColumnSize(const IdentifierNameSet & identifiers) const { + /** for expressions containing no columns (or where columns could not be determined otherwise) assume maximum + * possible size so they do not have priority in eligibility over other expressions. */ + if (identifiers.empty()) + return std::numeric_limits::max(); + std::size_t size{}; for (const auto & identifier : identifiers)