remove dangerous optimisation

This commit is contained in:
chertus 2020-02-20 20:19:16 +03:00
parent 56fa3cc1eb
commit f683437a8c
2 changed files with 1 additions and 6 deletions

View File

@ -31,11 +31,6 @@ JoinSwitcher::JoinSwitcher(std::shared_ptr<AnalyzedJoin> 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)

View File

@ -64,7 +64,7 @@ public:
private:
JoinPtr join;
SizeLimits limits;
mutable std::atomic<bool> switched;
bool switched;
mutable std::mutex switch_mutex;
std::shared_ptr<AnalyzedJoin> table_join;
const Block right_sample_block;