From 8bc64303bededc9084e1cc5cb78488ad7f17f1d9 Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Wed, 15 May 2013 13:45:44 +0000 Subject: [PATCH] clickhouse: addition to previous commit [#CONV-6705]. --- dbms/src/Storages/StorageChunkMerger.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dbms/src/Storages/StorageChunkMerger.cpp b/dbms/src/Storages/StorageChunkMerger.cpp index a581147d916..ff76867cbb2 100644 --- a/dbms/src/Storages/StorageChunkMerger.cpp +++ b/dbms/src/Storages/StorageChunkMerger.cpp @@ -215,8 +215,7 @@ bool StorageChunkMerger::maybeMergeSomething() Storages chunks = selectChunksToMerge(); if (chunks.empty()) return false; - mergeChunks(chunks); - return true; + return mergeChunks(chunks); } StorageChunkMerger::Storages StorageChunkMerger::selectChunksToMerge() @@ -276,7 +275,7 @@ static std::string FormatColumnsForCreateQuery(NamesAndTypesList & columns) return res; } -void StorageChunkMerger::mergeChunks(const Storages & chunks) +bool StorageChunkMerger::mergeChunks(const Storages & chunks) { typedef std::map ColumnsMap; @@ -327,7 +326,7 @@ void StorageChunkMerger::mergeChunks(const Storages & chunks) if (currently_written_groups.count(new_table_full_name)) { LOG_WARNING(log, "Table " + new_table_full_name + " is already being written. Aborting merge."); - return; + return false; } currently_written_groups.insert(new_table_full_name); @@ -478,6 +477,8 @@ void StorageChunkMerger::mergeChunks(const Storages & chunks) new_storage->removeReference(); LOG_TRACE(log, "Merged chunks."); + + return true; } catch(...) {