From 74fee0dc988f78ffa9edacfd80027b3f02226a65 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 27 Aug 2018 21:20:58 +0300 Subject: [PATCH] Enabling -Wshadow [#CLICKHOUSE-2] --- dbms/src/Columns/ColumnNullable.cpp | 42 ++++++++++++++-------------- dbms/src/Interpreters/Aggregator.cpp | 6 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dbms/src/Columns/ColumnNullable.cpp b/dbms/src/Columns/ColumnNullable.cpp index 5235bd23d04..1045f6ed2cb 100644 --- a/dbms/src/Columns/ColumnNullable.cpp +++ b/dbms/src/Columns/ColumnNullable.cpp @@ -366,28 +366,28 @@ void ColumnNullable::getExtremes(Field & min, Field & max) const min = Null(); max = Null(); - const auto & null_map = getNullMapData(); + const auto & null_map_data = getNullMapData(); - if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); - else if (const auto col = typeid_cast(nested_column.get())) - getExtremesFromNullableContent(*col, null_map, min, max); + if (const auto col_i8 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_i8, null_map_data, min, max); + else if (const auto col_i16 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_i16, null_map_data, min, max); + else if (const auto col_i32 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_i32, null_map_data, min, max); + else if (const auto col_i64 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_i64, null_map_data, min, max); + else if (const auto col_u8 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_u8, null_map_data, min, max); + else if (const auto col_u16 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_u16, null_map_data, min, max); + else if (const auto col_u32 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_u32, null_map_data, min, max); + else if (const auto col_u64 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_u64, null_map_data, min, max); + else if (const auto col_f32 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_f32, null_map_data, min, max); + else if (const auto col_f64 = typeid_cast(nested_column.get())) + getExtremesFromNullableContent(*col_f64, null_map_data, min, max); } diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index 6279970159e..5359b8c37da 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -561,7 +561,7 @@ void NO_INLINE Aggregator::executeImplCase( bool overflow = false; /// The new key did not fit in the hash table because of no_more_keys. /// Get the key to insert into the hash table. - typename Method::Key key = state.getKey(key_columns, params.keys_size, i, keys, *aggregates_pool); + typename Method::Key key = state.getKey(key_columns, params.keys_size, i, key_sizes, keys, *aggregates_pool); if (!no_more_keys) /// Insert. { @@ -1074,7 +1074,7 @@ void NO_INLINE Aggregator::convertToBlockImplFinal( { for (const auto & value : data) { - method.insertKeyIntoColumns(value, key_columns, params.keys_size); + method.insertKeyIntoColumns(value, key_columns, params.keys_size, key_sizes); for (size_t i = 0; i < params.aggregates_size; ++i) aggregate_functions[i]->insertResultInto( @@ -1095,7 +1095,7 @@ void NO_INLINE Aggregator::convertToBlockImplNotFinal( for (auto & value : data) { - method.insertKeyIntoColumns(value, key_columns, params.keys_size); + method.insertKeyIntoColumns(value, key_columns, params.keys_size, key_sizes); /// reserved, so push_back does not throw exceptions for (size_t i = 0; i < params.aggregates_size; ++i)