From b7ca838dc0c52b53b02d37af92f56c0c9fe0eee3 Mon Sep 17 00:00:00 2001 From: Alexey Arno Date: Sun, 11 Sep 2016 13:06:34 +0300 Subject: [PATCH] dbms: Server: cleanups [#METR-19266] --- .../DB/AggregateFunctions/AggregateFunctionNull.h | 2 +- .../DataStreams/MaterializingBlockOutputStream.h | 14 +++++++------- dbms/include/DB/Functions/FunctionsStringArray.h | 4 ++-- dbms/include/DB/Parsers/ExpressionListParsers.h | 2 +- .../DB/Storages/MergeTree/MergeTreeReader.h | 1 - dbms/src/DataTypes/DataTypeNullable.cpp | 2 +- dbms/src/Storages/StorageLog.cpp | 7 ++----- 7 files changed, 14 insertions(+), 18 deletions(-) diff --git a/dbms/include/DB/AggregateFunctions/AggregateFunctionNull.h b/dbms/include/DB/AggregateFunctions/AggregateFunctionNull.h index 5d1029e3119..19f00dd3033 100644 --- a/dbms/include/DB/AggregateFunctions/AggregateFunctionNull.h +++ b/dbms/include/DB/AggregateFunctions/AggregateFunctionNull.h @@ -60,7 +60,7 @@ public: nested_function->setArguments(new_args); } - void setParameters(const Array & params) + void setParameters(const Array & params) override { nested_function->setParameters(params); } diff --git a/dbms/include/DB/DataStreams/MaterializingBlockOutputStream.h b/dbms/include/DB/DataStreams/MaterializingBlockOutputStream.h index 31f084a933f..79b7b0538a0 100644 --- a/dbms/include/DB/DataStreams/MaterializingBlockOutputStream.h +++ b/dbms/include/DB/DataStreams/MaterializingBlockOutputStream.h @@ -12,13 +12,13 @@ class MaterializingBlockOutputStream : public IBlockOutputStream public: MaterializingBlockOutputStream(const BlockOutputStreamPtr & output); void write(const Block & block) override; - void flush(); - void writePrefix(); - void writeSuffix(); - void setRowsBeforeLimit(size_t rows_before_limit); - void setTotals(const Block & totals); - void setExtremes(const Block & extremes); - String getContentType() const; + void flush() override; + void writePrefix() override; + void writeSuffix() override; + void setRowsBeforeLimit(size_t rows_before_limit) override; + void setTotals(const Block & totals) override; + void setExtremes(const Block & extremes) override; + String getContentType() const override; private: static Block materialize(const Block & original_block); diff --git a/dbms/include/DB/Functions/FunctionsStringArray.h b/dbms/include/DB/Functions/FunctionsStringArray.h index 1e584261181..2e963ac3f0c 100644 --- a/dbms/include/DB/Functions/FunctionsStringArray.h +++ b/dbms/include/DB/Functions/FunctionsStringArray.h @@ -419,7 +419,7 @@ public: class FunctionArrayStringConcat : public IFunction { private: - void executeImpl( + void executeInternal( const ColumnString::Chars_t & src_chars, const ColumnString::Offsets_t & src_string_offsets, const ColumnArray::Offsets_t & src_array_offsets, @@ -541,7 +541,7 @@ public: std::shared_ptr col_res = std::make_shared(); block.getByPosition(result).column = col_res; - executeImpl( + executeInternal( col_string.getChars(), col_string.getOffsets(), col_arr.getOffsets(), delimiter.data(), delimiter.size(), col_res->getChars(), col_res->getOffsets()); diff --git a/dbms/include/DB/Parsers/ExpressionListParsers.h b/dbms/include/DB/Parsers/ExpressionListParsers.h index a9d6976d00f..d16f0f7a211 100644 --- a/dbms/include/DB/Parsers/ExpressionListParsers.h +++ b/dbms/include/DB/Parsers/ExpressionListParsers.h @@ -213,7 +213,7 @@ protected: class ParserNullityChecking : public IParserBase { protected: - const char * getName() const { return "nullity checking"; } + const char * getName() const override { return "nullity checking"; } bool parseImpl(Pos & pos, Pos end, ASTPtr & node, Pos & max_parsed_pos, Expected & expected) override; }; diff --git a/dbms/include/DB/Storages/MergeTree/MergeTreeReader.h b/dbms/include/DB/Storages/MergeTree/MergeTreeReader.h index 7b4bf1bef68..9cf1682379f 100644 --- a/dbms/include/DB/Storages/MergeTree/MergeTreeReader.h +++ b/dbms/include/DB/Storages/MergeTree/MergeTreeReader.h @@ -99,7 +99,6 @@ private: std::unique_ptr non_cached_buffer; std::string path_prefix; std::string extension; - size_t max_mark_range; }; using FileStreams = std::map>; diff --git a/dbms/src/DataTypes/DataTypeNullable.cpp b/dbms/src/DataTypes/DataTypeNullable.cpp index a9bae32493b..d5c19d16a66 100644 --- a/dbms/src/DataTypes/DataTypeNullable.cpp +++ b/dbms/src/DataTypes/DataTypeNullable.cpp @@ -58,7 +58,7 @@ struct NullDeserializer if (*istr.position() == Null::name[0]) { ++istr.position(); - static constexpr auto length = strlen(Null::name); + static constexpr auto length = __builtin_strlen(Null::name); if (length > 1) assertString(&Null::name[1], istr); diff --git a/dbms/src/Storages/StorageLog.cpp b/dbms/src/Storages/StorageLog.cpp index 2df7e790663..b53f077f91d 100644 --- a/dbms/src/Storages/StorageLog.cpp +++ b/dbms/src/Storages/StorageLog.cpp @@ -59,8 +59,7 @@ public: null_mark_number(0), rows_limit(rows_limit_), current_mark(mark_number_), - max_read_buffer_size(max_read_buffer_size_), - has_null_marks(false) + max_read_buffer_size(max_read_buffer_size_) { } @@ -75,8 +74,7 @@ public: null_mark_number(null_mark_number_), rows_limit(rows_limit_), current_mark(mark_number_), - max_read_buffer_size(max_read_buffer_size_), - has_null_marks(true) + max_read_buffer_size(max_read_buffer_size_) { } @@ -108,7 +106,6 @@ private: size_t rows_read = 0; size_t current_mark; size_t max_read_buffer_size; - bool has_null_marks; struct Stream {