From 1f51f57ac30a3b98a822f166dcea02d770861668 Mon Sep 17 00:00:00 2001 From: Nikolai Kochetov Date: Mon, 19 Mar 2018 21:54:15 +0300 Subject: [PATCH] fix build --- dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp | 4 ++-- dbms/src/Dictionaries/FlatDictionary.cpp | 4 ++-- dbms/src/Dictionaries/HashedDictionary.cpp | 4 ++-- dbms/src/Functions/IFunction.cpp | 2 +- dbms/src/Interpreters/Join.cpp | 2 +- dbms/src/Storages/MergeTree/MergeTreeReader.cpp | 4 ++-- dbms/src/Storages/StorageBuffer.cpp | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp b/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp index 0f8c75ebd89..fd15f334c8d 100644 --- a/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp +++ b/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp @@ -289,7 +289,7 @@ void ComplexKeyHashedDictionary::updateData() for (const auto attribute_idx : ext::range(0, keys_size + attributes_size)) { const IColumn & update_column = *block.getByPosition(attribute_idx).column.get(); - MutableColumnPtr saved_column = saved_block->getByPosition(attribute_idx).column->mutate(); + MutableColumnPtr saved_column = saved_block->getByPosition(attribute_idx).column->assumeMutable(); saved_column->insertRangeFrom(update_column, 0, update_column.size()); } } @@ -300,7 +300,7 @@ void ComplexKeyHashedDictionary::updateData() auto stream = source_ptr->loadUpdatedAll(); stream->readPrefix(); - while (const auto block = stream->read()) + while (auto block = stream->read()) { const auto saved_key_column_ptrs = ext::map(ext::range(0, keys_size), [&](const size_t key_idx) { diff --git a/dbms/src/Dictionaries/FlatDictionary.cpp b/dbms/src/Dictionaries/FlatDictionary.cpp index 0fc477725be..db610ef0ae4 100644 --- a/dbms/src/Dictionaries/FlatDictionary.cpp +++ b/dbms/src/Dictionaries/FlatDictionary.cpp @@ -316,7 +316,7 @@ void FlatDictionary::updateData() for (const auto attribute_idx : ext::range(0, attributes.size() + 1)) { const IColumn & update_column = *block.getByPosition(attribute_idx).column.get(); - MutableColumnPtr saved_column = saved_block->getByPosition(attribute_idx).column->mutate(); + MutableColumnPtr saved_column = saved_block->getByPosition(attribute_idx).column->assumeMutable(); saved_column->insertRangeFrom(update_column, 0, update_column.size()); } } @@ -327,7 +327,7 @@ void FlatDictionary::updateData() auto stream = source_ptr->loadUpdatedAll(); stream->readPrefix(); - while (const auto block = stream->read()) + while (auto block = stream->read()) { const auto &saved_id_column = *saved_block->safeGetByPosition(0).column; const auto &update_id_column = *block.safeGetByPosition(0).column; diff --git a/dbms/src/Dictionaries/HashedDictionary.cpp b/dbms/src/Dictionaries/HashedDictionary.cpp index c0c7f1a8a17..4b5e123a84e 100644 --- a/dbms/src/Dictionaries/HashedDictionary.cpp +++ b/dbms/src/Dictionaries/HashedDictionary.cpp @@ -310,7 +310,7 @@ void HashedDictionary::updateData() for (const auto attribute_idx : ext::range(0, attributes.size() + 1)) { const IColumn & update_column = *block.getByPosition(attribute_idx).column.get(); - MutableColumnPtr saved_column = saved_block->getByPosition(attribute_idx).column->mutate(); + MutableColumnPtr saved_column = saved_block->getByPosition(attribute_idx).column->assumeMutable(); saved_column->insertRangeFrom(update_column, 0, update_column.size()); } } @@ -321,7 +321,7 @@ void HashedDictionary::updateData() auto stream = source_ptr->loadUpdatedAll(); stream->readPrefix(); - while (const auto block = stream->read()) + while (auto block = stream->read()) { const auto &saved_id_column = *saved_block->safeGetByPosition(0).column; const auto &update_id_column = *block.safeGetByPosition(0).column; diff --git a/dbms/src/Functions/IFunction.cpp b/dbms/src/Functions/IFunction.cpp index c074b3ee73d..b9660b236e5 100644 --- a/dbms/src/Functions/IFunction.cpp +++ b/dbms/src/Functions/IFunction.cpp @@ -85,7 +85,7 @@ MutableColumnPtr wrapInNullable(MutableColumnPtr && src, Block & block, const Co if (src_not_nullable->isColumnConst()) return ColumnNullable::create(src_not_nullable->convertToFullColumnIfConst(), std::move(result_null_map_column)); else - return ColumnNullable::create(src_not_nullable, std::move(result_null_map_column)); + return ColumnNullable::create(std::move(src_not_nullable), std::move(result_null_map_column)); } diff --git a/dbms/src/Interpreters/Join.cpp b/dbms/src/Interpreters/Join.cpp index eecb108e1a5..3e5431aae80 100644 --- a/dbms/src/Interpreters/Join.cpp +++ b/dbms/src/Interpreters/Join.cpp @@ -245,7 +245,7 @@ static void convertColumnToNullable(ColumnWithTypeAndName & column) { column.type = makeNullable(column.type); if (column.column) - column.column = makeNullable(column.column); + column.column = makeNullable(column.column->assumeMutable()); } diff --git a/dbms/src/Storages/MergeTree/MergeTreeReader.cpp b/dbms/src/Storages/MergeTree/MergeTreeReader.cpp index e172760b17f..90e66cafe9e 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeReader.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeReader.cpp @@ -481,9 +481,9 @@ void MergeTreeReader::fillMissingColumns(Block & res, const Names & ordered_name size_t nested_rows = offsets_column->empty() ? 0 : typeid_cast(*offsets_column).getData().back(); - ColumnPtr nested_column = nested_type->createColumnConstWithDefaultValue(nested_rows)->convertToFullColumnIfConst(); + auto nested_column = nested_type->createColumnConstWithDefaultValue(nested_rows)->convertToFullColumnIfConst(); - column_to_add.column = ColumnArray::create(nested_column, offsets_column); + column_to_add.column = ColumnArray::create(std::move(nested_column), offsets_column); } else { diff --git a/dbms/src/Storages/StorageBuffer.cpp b/dbms/src/Storages/StorageBuffer.cpp index 5769e5708cc..8688d191b9a 100644 --- a/dbms/src/Storages/StorageBuffer.cpp +++ b/dbms/src/Storages/StorageBuffer.cpp @@ -183,7 +183,7 @@ static void appendBlock(const Block & from, Block & to) { ColumnPtr & col_to = to.getByPosition(column_no).column; if (col_to->size() != old_rows) - col_to = col_to->mutate()->cut(0, old_rows); + col_to = (*std::move(col_to)).mutate()->cut(0, old_rows); } } catch (...)