diff --git a/dbms/include/DB/Storages/StorageMergeTree.h b/dbms/include/DB/Storages/StorageMergeTree.h index 92b782378dd..9db9dd5481f 100644 --- a/dbms/include/DB/Storages/StorageMergeTree.h +++ b/dbms/include/DB/Storages/StorageMergeTree.h @@ -151,7 +151,7 @@ private: /// Описание куска с данными. struct DataPart { - DataPart(StorageMergeTree & storage_) : storage(storage_) {} + DataPart(StorageMergeTree & storage_) : storage(storage_), currently_merging(false) {} StorageMergeTree & storage; Yandex::DayNum_t left_date; diff --git a/dbms/src/Storages/StorageMergeTree.cpp b/dbms/src/Storages/StorageMergeTree.cpp index 38817043500..6bfb114a6b4 100644 --- a/dbms/src/Storages/StorageMergeTree.cpp +++ b/dbms/src/Storages/StorageMergeTree.cpp @@ -1234,7 +1234,7 @@ void StorageMergeTree::merge(size_t iterations, bool async) iterations = settings.merging_threads; } - for (size_t i = 0; i < settings.merging_threads; ++i) + for (size_t i = 0; i < iterations; ++i) merge_threads->schedule(boost::bind(&StorageMergeTree::mergeThread, this, while_can)); if (!async) @@ -1246,9 +1246,6 @@ void StorageMergeTree::mergeThread(bool while_can) { try { - DataPartPtr left; - DataPartPtr right; - std::vector parts; while (selectPartsToMerge(parts)) {