From f683437a8cb0cd40f0cc45ab4745824028e3949a Mon Sep 17 00:00:00 2001 From: chertus Date: Thu, 20 Feb 2020 20:19:16 +0300 Subject: [PATCH] remove dangerous optimisation --- dbms/src/Interpreters/JoinSwitcher.cpp | 5 ----- dbms/src/Interpreters/JoinSwitcher.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/dbms/src/Interpreters/JoinSwitcher.cpp b/dbms/src/Interpreters/JoinSwitcher.cpp index d500f55fc5a..142a7a1af94 100644 --- a/dbms/src/Interpreters/JoinSwitcher.cpp +++ b/dbms/src/Interpreters/JoinSwitcher.cpp @@ -31,11 +31,6 @@ JoinSwitcher::JoinSwitcher(std::shared_ptr table_join_, const Bloc bool JoinSwitcher::addJoinedBlock(const Block & block, bool) { - /// Trying to make MergeJoin without lock - - if (switched.load(std::memory_order_relaxed)) - return join->addJoinedBlock(block); - std::lock_guard lock(switch_mutex); if (switched) diff --git a/dbms/src/Interpreters/JoinSwitcher.h b/dbms/src/Interpreters/JoinSwitcher.h index 487f35d4d6b..47ed2b8bc57 100644 --- a/dbms/src/Interpreters/JoinSwitcher.h +++ b/dbms/src/Interpreters/JoinSwitcher.h @@ -64,7 +64,7 @@ public: private: JoinPtr join; SizeLimits limits; - mutable std::atomic switched; + bool switched; mutable std::mutex switch_mutex; std::shared_ptr table_join; const Block right_sample_block;