From 6c40d9b51ee09c596294a96184303d6e74c506f4 Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Wed, 19 Oct 2016 21:18:02 +0300 Subject: [PATCH] dbms: Server: fixes [#METR-19266] --- dbms/src/Functions/IFunction.cpp | 6 ++---- dbms/src/Storages/MergeTree/MergeTreeData.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dbms/src/Functions/IFunction.cpp b/dbms/src/Functions/IFunction.cpp index 3cd03c5b07c..e41da2e56a8 100644 --- a/dbms/src/Functions/IFunction.cpp +++ b/dbms/src/Functions/IFunction.cpp @@ -352,8 +352,6 @@ void IFunction::postProcessResult(Strategy strategy, Block & block, const Block throw Exception{"IFunction: internal error", ErrorCodes::LOGICAL_ERROR}; } -/// Return a copy of a given block in which the specified columns are replaced by -/// their respective nested columns if they are nullable. Block IFunction::createBlockWithNestedColumns(const Block & block, ColumnNumbers args) { std::sort(args.begin(), args.end()); @@ -373,10 +371,10 @@ Block IFunction::createBlockWithNestedColumns(const Block & block, ColumnNumbers if (col.column->isNullable()) { auto nullable_col = static_cast(col.column.get()); - ColumnPtr nested_col = nullable_col->getNestedColumn(); + const ColumnPtr & nested_col = nullable_col->getNestedColumn(); auto nullable_type = static_cast(col.type.get()); - DataTypePtr nested_type = nullable_type->getNestedType(); + const DataTypePtr & nested_type = nullable_type->getNestedType(); res.insert(i, {nested_col, nested_type, col.name}); diff --git a/dbms/src/Storages/MergeTree/MergeTreeData.cpp b/dbms/src/Storages/MergeTree/MergeTreeData.cpp index baf5dfd4412..490610ebe4e 100644 --- a/dbms/src/Storages/MergeTree/MergeTreeData.cpp +++ b/dbms/src/Storages/MergeTree/MergeTreeData.cpp @@ -863,7 +863,7 @@ MergeTreeData::AlterDataPartTransactionPtr MergeTreeData::alterDataPart( if (it.second == "") new_checksums.files.erase(it.first); else - new_checksums.files[it.second] = add_checksums.files.at(it.first); + new_checksums.files[it.second] = add_checksums.files[it.first]; } if (new_primary_key_file_size)