From 431da20d99fd884aac1d7983de1d07b308481cb7 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 1 Dec 2017 23:21:35 +0300 Subject: [PATCH] Better [#CLICKHOUSE-2]. --- dbms/src/Common/NaNUtils.h | 4 +- dbms/src/DataStreams/FormatFactory.cpp | 4 +- .../SummingSortedBlockInputStream.cpp | 6 +- .../SummingSortedBlockInputStream.h | 2 +- .../DataStreams/VerticalRowOutputStream.cpp | 2 +- .../src/DataStreams/VerticalRowOutputStream.h | 2 +- .../DataTypes/DataTypeAggregateFunction.cpp | 2 +- dbms/src/DataTypes/DataTypeArray.cpp | 2 +- dbms/src/DataTypes/DataTypeDate.cpp | 2 +- dbms/src/DataTypes/DataTypeDateTime.cpp | 2 +- dbms/src/DataTypes/DataTypeEnum.cpp | 2 +- dbms/src/DataTypes/DataTypeFixedString.cpp | 4 +- dbms/src/DataTypes/DataTypeNull.cpp | 24 ++++---- dbms/src/DataTypes/DataTypeNumberBase.cpp | 55 +++++++++---------- dbms/src/DataTypes/DataTypeString.cpp | 12 ++-- dbms/src/DataTypes/DataTypeUUID.cpp | 2 +- dbms/src/DataTypes/FieldToDataType.cpp | 6 +- dbms/src/DataTypes/IDataType.cpp | 4 +- dbms/src/Databases/DatabaseDictionary.cpp | 52 +++++++++--------- dbms/src/Databases/DatabaseMemory.cpp | 51 +++++++++-------- dbms/src/Dictionaries/CacheDictionary.cpp | 8 +-- ...acheDictionary_createAttributeWithType.cpp | 2 +- .../ComplexKeyHashedDictionary.cpp | 8 +-- .../Dictionaries/DictionaryBlockInputStream.h | 8 +-- .../Dictionaries/DictionarySourceFactory.cpp | 3 + .../Embedded/TechDataHierarchy.cpp | 2 +- .../Dictionaries/Embedded/TechDataHierarchy.h | 2 +- dbms/src/Dictionaries/FileDictionarySource.h | 4 +- dbms/src/Dictionaries/FlatDictionary.cpp | 12 ++-- dbms/src/Dictionaries/HashedDictionary.cpp | 10 ++-- dbms/src/Dictionaries/IDictionary.h | 6 +- .../Dictionaries/MongoDBBlockInputStream.cpp | 9 ++- .../Dictionaries/MongoDBDictionarySource.cpp | 13 +++-- dbms/src/Dictionaries/ODBCBlockInputStream.h | 9 ++- .../src/Dictionaries/ODBCDictionarySource.cpp | 7 ++- .../Dictionaries/RangeHashedDictionary.cpp | 2 +- dbms/src/Dictionaries/TrieDictionary.cpp | 10 ++-- dbms/src/Functions/FunctionHelpers.h | 2 +- dbms/src/Interpreters/Aggregator.cpp | 8 +-- dbms/src/Interpreters/Aggregator.h | 4 +- dbms/src/Interpreters/Cluster.cpp | 2 +- dbms/src/Interpreters/Context.cpp | 2 +- .../src/Interpreters/EmbeddedDictionaries.cpp | 2 +- libs/libmysqlxx/include/mysqlxx/Pool.h | 18 ++---- 44 files changed, 196 insertions(+), 197 deletions(-) diff --git a/dbms/src/Common/NaNUtils.h b/dbms/src/Common/NaNUtils.h index f180f9f3e6d..7109ccdd1ab 100644 --- a/dbms/src/Common/NaNUtils.h +++ b/dbms/src/Common/NaNUtils.h @@ -13,7 +13,7 @@ inline typename std::enable_if::value, bool>::type isN } template -inline typename std::enable_if::value, bool>::type isNaN(T x) +inline typename std::enable_if::value, bool>::type isNaN(T) { return false; } @@ -25,7 +25,7 @@ inline typename std::enable_if::value, bool>::type isF } template -inline typename std::enable_if::value, bool>::type isFinite(T x) +inline typename std::enable_if::value, bool>::type isFinite(T) { return true; } diff --git a/dbms/src/DataStreams/FormatFactory.cpp b/dbms/src/DataStreams/FormatFactory.cpp index e26f2ab6fa3..d8834302dc2 100644 --- a/dbms/src/DataStreams/FormatFactory.cpp +++ b/dbms/src/DataStreams/FormatFactory.cpp @@ -181,10 +181,10 @@ static BlockOutputStreamPtr getOutputImpl(const String & name, WriteBuffer & buf return std::make_shared(buf, true, settings.output_format_pretty_max_rows, context); else if (name == "Vertical") return std::make_shared(std::make_shared( - buf, sample, settings.output_format_pretty_max_rows, context)); + buf, sample, settings.output_format_pretty_max_rows)); else if (name == "VerticalRaw") return std::make_shared(std::make_shared( - buf, sample, settings.output_format_pretty_max_rows, context)); + buf, sample, settings.output_format_pretty_max_rows)); else if (name == "Values") return std::make_shared(std::make_shared(buf)); else if (name == "JSON") diff --git a/dbms/src/DataStreams/SummingSortedBlockInputStream.cpp b/dbms/src/DataStreams/SummingSortedBlockInputStream.cpp index 226e8bf9409..325b8b19e44 100644 --- a/dbms/src/DataStreams/SummingSortedBlockInputStream.cpp +++ b/dbms/src/DataStreams/SummingSortedBlockInputStream.cpp @@ -338,12 +338,12 @@ void SummingSortedBlockInputStream::merge(ColumnPlainPtrs & merged_columns, std: desc.createState(); // Start aggregations with current row - addRow(current_row, current); + addRow(current); current_row_is_zero = true; } else { - addRow(current_row, current); + addRow(current); // Merge maps only for same rows for (auto & desc : maps_to_sum) @@ -456,7 +456,7 @@ bool SummingSortedBlockInputStream::mergeMap(const MapDescription & desc, Row & template -void SummingSortedBlockInputStream::addRow(Row & row, TSortCursor & cursor) +void SummingSortedBlockInputStream::addRow(TSortCursor & cursor) { for (auto & desc : columns_to_aggregate) { diff --git a/dbms/src/DataStreams/SummingSortedBlockInputStream.h b/dbms/src/DataStreams/SummingSortedBlockInputStream.h index fba61bccd3d..244680a7f97 100644 --- a/dbms/src/DataStreams/SummingSortedBlockInputStream.h +++ b/dbms/src/DataStreams/SummingSortedBlockInputStream.h @@ -151,7 +151,7 @@ private: // Add the row under the cursor to the `row`. template - void addRow(Row & row, TSortCursor & cursor); + void addRow(TSortCursor & cursor); }; } diff --git a/dbms/src/DataStreams/VerticalRowOutputStream.cpp b/dbms/src/DataStreams/VerticalRowOutputStream.cpp index b4f6428987e..bdc3c245fea 100644 --- a/dbms/src/DataStreams/VerticalRowOutputStream.cpp +++ b/dbms/src/DataStreams/VerticalRowOutputStream.cpp @@ -12,7 +12,7 @@ namespace DB { VerticalRowOutputStream::VerticalRowOutputStream( - WriteBuffer & ostr_, const Block & sample_, size_t max_rows_, const Context & context) + WriteBuffer & ostr_, const Block & sample_, size_t max_rows_) : ostr(ostr_), sample(sample_), max_rows(max_rows_) { size_t columns = sample.columns(); diff --git a/dbms/src/DataStreams/VerticalRowOutputStream.h b/dbms/src/DataStreams/VerticalRowOutputStream.h index f3a4444734a..4dbd6e44c6d 100644 --- a/dbms/src/DataStreams/VerticalRowOutputStream.h +++ b/dbms/src/DataStreams/VerticalRowOutputStream.h @@ -18,7 +18,7 @@ class Context; class VerticalRowOutputStream : public IRowOutputStream { public: - VerticalRowOutputStream(WriteBuffer & ostr_, const Block & sample_, size_t max_rows_, const Context & context); + VerticalRowOutputStream(WriteBuffer & ostr_, const Block & sample_, size_t max_rows_); void writeField(const IColumn & column, const IDataType & type, size_t row_num) override; void writeRowStartDelimiter() override; diff --git a/dbms/src/DataTypes/DataTypeAggregateFunction.cpp b/dbms/src/DataTypes/DataTypeAggregateFunction.cpp index 488f40b328f..bdef282efa7 100644 --- a/dbms/src/DataTypes/DataTypeAggregateFunction.cpp +++ b/dbms/src/DataTypes/DataTypeAggregateFunction.cpp @@ -110,7 +110,7 @@ void DataTypeAggregateFunction::serializeBinaryBulk(const IColumn & column, Writ function->serialize(*it, ostr); } -void DataTypeAggregateFunction::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const +void DataTypeAggregateFunction::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double /*avg_value_size_hint*/) const { ColumnAggregateFunction & real_column = typeid_cast(column); ColumnAggregateFunction::Container_t & vec = real_column.getData(); diff --git a/dbms/src/DataTypes/DataTypeArray.cpp b/dbms/src/DataTypes/DataTypeArray.cpp index c9ba02d1e44..9b2b9670107 100644 --- a/dbms/src/DataTypes/DataTypeArray.cpp +++ b/dbms/src/DataTypes/DataTypeArray.cpp @@ -214,7 +214,7 @@ void DataTypeArray::deserializeBinaryBulkWithMultipleStreams( IColumn & column, InputStreamGetter getter, size_t limit, - double avg_value_size_hint, + double /*avg_value_size_hint*/, bool position_independent_encoding, SubstreamPath path) const { diff --git a/dbms/src/DataTypes/DataTypeDate.cpp b/dbms/src/DataTypes/DataTypeDate.cpp index 97cc0eeb55d..5f179f31875 100644 --- a/dbms/src/DataTypes/DataTypeDate.cpp +++ b/dbms/src/DataTypes/DataTypeDate.cpp @@ -70,7 +70,7 @@ void DataTypeDate::serializeTextCSV(const IColumn & column, size_t row_num, Writ writeChar('"', ostr); } -void DataTypeDate::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeDate::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char /*delimiter*/) const { LocalDate value; readCSV(value, istr); diff --git a/dbms/src/DataTypes/DataTypeDateTime.cpp b/dbms/src/DataTypes/DataTypeDateTime.cpp index 03d10d289c6..fc1ef2f1d4e 100644 --- a/dbms/src/DataTypes/DataTypeDateTime.cpp +++ b/dbms/src/DataTypes/DataTypeDateTime.cpp @@ -94,7 +94,7 @@ void DataTypeDateTime::serializeTextCSV(const IColumn & column, size_t row_num, writeChar('"', ostr); } -void DataTypeDateTime::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeDateTime::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char /*delimiter*/) const { time_t x; readDateTimeCSV(x, istr, time_zone); diff --git a/dbms/src/DataTypes/DataTypeEnum.cpp b/dbms/src/DataTypes/DataTypeEnum.cpp index 0ab7822ada7..e2e6a861ce1 100644 --- a/dbms/src/DataTypes/DataTypeEnum.cpp +++ b/dbms/src/DataTypes/DataTypeEnum.cpp @@ -226,7 +226,7 @@ void DataTypeEnum::serializeBinaryBulk( template void DataTypeEnum::deserializeBinaryBulk( - IColumn & column, ReadBuffer & istr, const size_t limit, const double avg_value_size_hint) const + IColumn & column, ReadBuffer & istr, const size_t limit, const double /*avg_value_size_hint*/) const { auto & x = typeid_cast(column).getData(); const auto initial_size = x.size(); diff --git a/dbms/src/DataTypes/DataTypeFixedString.cpp b/dbms/src/DataTypes/DataTypeFixedString.cpp index d16b4840231..4ae3b18863f 100644 --- a/dbms/src/DataTypes/DataTypeFixedString.cpp +++ b/dbms/src/DataTypes/DataTypeFixedString.cpp @@ -91,7 +91,7 @@ void DataTypeFixedString::serializeBinaryBulk(const IColumn & column, WriteBuffe } -void DataTypeFixedString::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const +void DataTypeFixedString::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double /*avg_value_size_hint*/) const { ColumnFixedString::Chars_t & data = typeid_cast(column).getChars(); @@ -194,7 +194,7 @@ void DataTypeFixedString::serializeTextCSV(const IColumn & column, size_t row_nu } -void DataTypeFixedString::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeFixedString::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char /*delimiter*/) const { read(*this, column, [&istr](ColumnFixedString::Chars_t & data) { readCSVStringInto(data, istr); }); } diff --git a/dbms/src/DataTypes/DataTypeNull.cpp b/dbms/src/DataTypes/DataTypeNull.cpp index fd289568709..ee1189293a1 100644 --- a/dbms/src/DataTypes/DataTypeNull.cpp +++ b/dbms/src/DataTypes/DataTypeNull.cpp @@ -26,7 +26,7 @@ void DataTypeNull::serializeBinaryBulk(const IColumn & column, WriteBuffer & ost writeBinary(x, ostr); } -void DataTypeNull::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const +void DataTypeNull::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double /*avg_value_size_hint*/) const { istr.ignore(sizeof(UInt8) * limit); @@ -45,7 +45,7 @@ size_t DataTypeNull::getSizeOfField() const return sizeof(UInt8); } -void DataTypeNull::serializeBinary(const Field & field, WriteBuffer & ostr) const +void DataTypeNull::serializeBinary(const Field & /*field*/, WriteBuffer & ostr) const { UInt8 x = 1; /// Value is 1 to be consistent with NULLs serialization in DataTypeNullable. writeBinary(x, ostr); @@ -58,7 +58,7 @@ void DataTypeNull::deserializeBinary(Field & field, ReadBuffer & istr) const field = Null(); } -void DataTypeNull::serializeBinary(const IColumn & column, size_t row_num, WriteBuffer & ostr) const +void DataTypeNull::serializeBinary(const IColumn & /*column*/, size_t /*row_num*/, WriteBuffer & ostr) const { UInt8 x = 1; writeBinary(x, ostr); @@ -71,47 +71,47 @@ void DataTypeNull::deserializeBinary(IColumn & column, ReadBuffer & istr) const column.insertDefault(); } -void DataTypeNull::serializeTextEscaped(const IColumn & column, size_t row_num, WriteBuffer & ostr) const +void DataTypeNull::serializeTextEscaped(const IColumn & /*column*/, size_t /*row_num*/, WriteBuffer & ostr) const { writeCString("\\N", ostr); } -void DataTypeNull::deserializeTextEscaped(IColumn & column, ReadBuffer & istr) const +void DataTypeNull::deserializeTextEscaped(IColumn & /*column*/, ReadBuffer & istr) const { assertString("\\N", istr); } -void DataTypeNull::serializeTextQuoted(const IColumn & column, size_t row_num, WriteBuffer & ostr) const +void DataTypeNull::serializeTextQuoted(const IColumn & /*column*/, size_t /*row_num*/, WriteBuffer & ostr) const { writeCString("NULL", ostr); } -void DataTypeNull::deserializeTextQuoted(IColumn & column, ReadBuffer & istr) const +void DataTypeNull::deserializeTextQuoted(IColumn & /*column*/, ReadBuffer & istr) const { assertStringCaseInsensitive("NULL", istr); } -void DataTypeNull::serializeTextCSV(const IColumn & column, size_t row_num, WriteBuffer & ostr) const +void DataTypeNull::serializeTextCSV(const IColumn & /*column*/, size_t /*row_num*/, WriteBuffer & ostr) const { writeCString("\\N", ostr); } -void DataTypeNull::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeNull::deserializeTextCSV(IColumn & /*column*/, ReadBuffer & istr, const char /*delimiter*/) const { assertString("\\N", istr); } -void DataTypeNull::serializeText(const IColumn & column, size_t row_num, WriteBuffer & ostr) const +void DataTypeNull::serializeText(const IColumn & /*column*/, size_t /*row_num*/, WriteBuffer & ostr) const { writeCString("NULL", ostr); } -void DataTypeNull::serializeTextJSON(const IColumn & column, size_t row_num, WriteBuffer & ostr, const FormatSettingsJSON &) const +void DataTypeNull::serializeTextJSON(const IColumn & /*column*/, size_t /*row_num*/, WriteBuffer & ostr, const FormatSettingsJSON &) const { writeCString("null", ostr); } -void DataTypeNull::deserializeTextJSON(IColumn & column, ReadBuffer & istr) const +void DataTypeNull::deserializeTextJSON(IColumn & /*column*/, ReadBuffer & istr) const { assertString("null", istr); } diff --git a/dbms/src/DataTypes/DataTypeNumberBase.cpp b/dbms/src/DataTypes/DataTypeNumberBase.cpp index b7fe9dbd14c..df5c395ce93 100644 --- a/dbms/src/DataTypes/DataTypeNumberBase.cpp +++ b/dbms/src/DataTypes/DataTypeNumberBase.cpp @@ -24,23 +24,16 @@ void DataTypeNumberBase::serializeTextEscaped(const IColumn & column, size_t } -template -static void readTextUnsafeIfIntegral(typename std::enable_if::value && std::is_arithmetic::value, T>::type & x, ReadBuffer & istr) -{ - readIntTextUnsafe(x, istr); -} - -template -static void readTextUnsafeIfIntegral(typename std::enable_if::value || !std::is_arithmetic::value, T>::type & x, ReadBuffer & istr) -{ - readText(x, istr); -} - template static void deserializeText(IColumn & column, ReadBuffer & istr) { T x; - readTextUnsafeIfIntegral(x, istr); + + if constexpr (std::is_integral::value && std::is_arithmetic::value) + readIntTextUnsafe(x, istr); + else + readText(x, istr); + static_cast &>(column).getData().push_back(x); } @@ -65,26 +58,28 @@ void DataTypeNumberBase::deserializeTextQuoted(IColumn & column, ReadBuffer & template -static inline typename std::enable_if::value, void>::type writeDenormalNumber(T x, WriteBuffer & ostr) +static inline void writeDenormalNumber(T x, WriteBuffer & ostr) { - if (std::signbit(x)) + if constexpr (std::is_floating_point::value) { - if (isNaN(x)) - writeCString("-nan", ostr); + if (std::signbit(x)) + { + if (isNaN(x)) + writeCString("-nan", ostr); + else + writeCString("-inf", ostr); + } else - writeCString("-inf", ostr); + { + if (isNaN(x)) + writeCString("nan", ostr); + else + writeCString("inf", ostr); + } } - else - { - if (isNaN(x)) - writeCString("nan", ostr); - else - writeCString("inf", ostr); - } -} -template -static inline typename std::enable_if::value, void>::type writeDenormalNumber(T x, WriteBuffer & ostr) {} + /// This function is not called for non floating point numbers. +} template @@ -168,7 +163,7 @@ void DataTypeNumberBase::serializeTextCSV(const IColumn & column, size_t row_ } template -void DataTypeNumberBase::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeNumberBase::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char /*delimiter*/) const { FieldType x; readCSV(x, istr); @@ -225,7 +220,7 @@ void DataTypeNumberBase::serializeBinaryBulk(const IColumn & column, WriteBuf } template -void DataTypeNumberBase::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const +void DataTypeNumberBase::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double /*avg_value_size_hint*/) const { typename ColumnVector::Container_t & x = typeid_cast &>(column).getData(); size_t initial_size = x.size(); diff --git a/dbms/src/DataTypes/DataTypeString.cpp b/dbms/src/DataTypes/DataTypeString.cpp index 255dd6943a4..496548a644b 100644 --- a/dbms/src/DataTypes/DataTypeString.cpp +++ b/dbms/src/DataTypes/DataTypeString.cpp @@ -219,7 +219,7 @@ void DataTypeString::serializeTextEscaped(const IColumn & column, size_t row_num template -static inline void read(IColumn & column, ReadBuffer & istr, Reader && reader) +static inline void read(IColumn & column, Reader && reader) { ColumnString & column_string = static_cast(column); ColumnString::Chars_t & data = column_string.getChars(); @@ -245,7 +245,7 @@ static inline void read(IColumn & column, ReadBuffer & istr, Reader && reader) void DataTypeString::deserializeTextEscaped(IColumn & column, ReadBuffer & istr) const { - read(column, istr, [&](ColumnString::Chars_t & data) { readEscapedStringInto(data, istr); }); + read(column, [&](ColumnString::Chars_t & data) { readEscapedStringInto(data, istr); }); } @@ -257,7 +257,7 @@ void DataTypeString::serializeTextQuoted(const IColumn & column, size_t row_num, void DataTypeString::deserializeTextQuoted(IColumn & column, ReadBuffer & istr) const { - read(column, istr, [&](ColumnString::Chars_t & data) { readQuotedStringInto(data, istr); }); + read(column, [&](ColumnString::Chars_t & data) { readQuotedStringInto(data, istr); }); } @@ -269,7 +269,7 @@ void DataTypeString::serializeTextJSON(const IColumn & column, size_t row_num, W void DataTypeString::deserializeTextJSON(IColumn & column, ReadBuffer & istr) const { - read(column, istr, [&](ColumnString::Chars_t & data) { readJSONStringInto(data, istr); }); + read(column, [&](ColumnString::Chars_t & data) { readJSONStringInto(data, istr); }); } @@ -285,9 +285,9 @@ void DataTypeString::serializeTextCSV(const IColumn & column, size_t row_num, Wr } -void DataTypeString::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeString::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char /*delimiter*/) const { - read(column, istr, [&](ColumnString::Chars_t & data) { readCSVStringInto(data, istr); }); + read(column, [&](ColumnString::Chars_t & data) { readCSVStringInto(data, istr); }); } diff --git a/dbms/src/DataTypes/DataTypeUUID.cpp b/dbms/src/DataTypes/DataTypeUUID.cpp index a01d1a3132e..dbc30b9958e 100644 --- a/dbms/src/DataTypes/DataTypeUUID.cpp +++ b/dbms/src/DataTypes/DataTypeUUID.cpp @@ -66,7 +66,7 @@ void DataTypeUUID::serializeTextCSV(const IColumn & column, size_t row_num, Writ writeChar('"', ostr); } -void DataTypeUUID::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char delimiter) const +void DataTypeUUID::deserializeTextCSV(IColumn & column, ReadBuffer & istr, const char /*delimiter*/) const { UUID value; readCSV(value, istr); diff --git a/dbms/src/DataTypes/FieldToDataType.cpp b/dbms/src/DataTypes/FieldToDataType.cpp index 05ccc3b47b1..df0211322d8 100644 --- a/dbms/src/DataTypes/FieldToDataType.cpp +++ b/dbms/src/DataTypes/FieldToDataType.cpp @@ -22,7 +22,7 @@ namespace ErrorCodes } -DataTypePtr FieldToDataType::operator() (Null & x) const +DataTypePtr FieldToDataType::operator() (Null &) const { return std::make_shared(); } @@ -43,12 +43,12 @@ DataTypePtr FieldToDataType::operator() (Int64 & x) const return std::make_shared(); } -DataTypePtr FieldToDataType::operator() (Float64 & x) const +DataTypePtr FieldToDataType::operator() (Float64 &) const { return std::make_shared(); } -DataTypePtr FieldToDataType::operator() (String & x) const +DataTypePtr FieldToDataType::operator() (String &) const { return std::make_shared(); } diff --git a/dbms/src/DataTypes/IDataType.cpp b/dbms/src/DataTypes/IDataType.cpp index 3b9bec4e16a..aaed1d61c49 100644 --- a/dbms/src/DataTypes/IDataType.cpp +++ b/dbms/src/DataTypes/IDataType.cpp @@ -45,12 +45,12 @@ ColumnPtr IDataType::createConstColumn(size_t size, const Field & field) const } -void IDataType::serializeBinaryBulk(const IColumn & column, WriteBuffer & ostr, size_t offset, size_t limit) const +void IDataType::serializeBinaryBulk(const IColumn &, WriteBuffer &, size_t, size_t) const { throw Exception("Data type " + getName() + " must be serialized with multiple streams", ErrorCodes::MULTIPLE_STREAMS_REQUIRED); } -void IDataType::deserializeBinaryBulk(IColumn & column, ReadBuffer & istr, size_t limit, double avg_value_size_hint) const +void IDataType::deserializeBinaryBulk(IColumn &, ReadBuffer &, size_t, double) const { throw Exception("Data type " + getName() + " must be deserialized with multiple streams", ErrorCodes::MULTIPLE_STREAMS_REQUIRED); } diff --git a/dbms/src/Databases/DatabaseDictionary.cpp b/dbms/src/Databases/DatabaseDictionary.cpp index 2979c6f83e7..17a32c0ff78 100644 --- a/dbms/src/Databases/DatabaseDictionary.cpp +++ b/dbms/src/Databases/DatabaseDictionary.cpp @@ -20,7 +20,7 @@ DatabaseDictionary::DatabaseDictionary(const String & name_, const Context & con { } -void DatabaseDictionary::loadTables(Context & context, ThreadPool * thread_pool, bool has_force_restore_data_flag) +void DatabaseDictionary::loadTables(Context &, ThreadPool *, bool) { } @@ -48,7 +48,7 @@ Tables DatabaseDictionary::loadTables() } bool DatabaseDictionary::isTableExist( - const Context & context, + const Context & /*context*/, const String & table_name) const { auto objects_map = external_dictionaries.getObjectsMap(); @@ -57,7 +57,7 @@ bool DatabaseDictionary::isTableExist( } StoragePtr DatabaseDictionary::tryGetTable( - const Context & context, + const Context & /*context*/, const String & table_name) { auto objects_map = external_dictionaries.getObjectsMap(); @@ -82,12 +82,12 @@ StoragePtr DatabaseDictionary::tryGetTable( return {}; } -DatabaseIteratorPtr DatabaseDictionary::getIterator(const Context & context) +DatabaseIteratorPtr DatabaseDictionary::getIterator(const Context & /*context*/) { return std::make_unique(loadTables()); } -bool DatabaseDictionary::empty(const Context & context) const +bool DatabaseDictionary::empty(const Context & /*context*/) const { auto objects_map = external_dictionaries.getObjectsMap(); const auto & dictionaries = objects_map.get(); @@ -97,21 +97,21 @@ bool DatabaseDictionary::empty(const Context & context) const return true; } -StoragePtr DatabaseDictionary::detachTable(const String & table_name) +StoragePtr DatabaseDictionary::detachTable(const String & /*table_name*/) { throw Exception("DatabaseDictionary: detachTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } -void DatabaseDictionary::attachTable(const String & table_name, const StoragePtr & table) +void DatabaseDictionary::attachTable(const String & /*table_name*/, const StoragePtr & /*table*/) { throw Exception("DatabaseDictionary: attachTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } void DatabaseDictionary::createTable( - const Context & context, - const String & table_name, - const StoragePtr & table, - const ASTPtr & query) + const Context & /*context*/, + const String & /*table_name*/, + const StoragePtr & /*table*/, + const ASTPtr & /*query*/) { throw Exception("DatabaseDictionary: createTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } @@ -128,36 +128,36 @@ void DatabaseDictionary::removeTable( } void DatabaseDictionary::renameTable( - const Context & context, - const String & table_name, - IDatabase & to_database, - const String & to_table_name) + const Context &, + const String &, + IDatabase &, + const String &) { throw Exception("DatabaseDictionary: renameTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } void DatabaseDictionary::alterTable( - const Context & context, - const String & name, - const NamesAndTypesList & columns, - const NamesAndTypesList & materialized_columns, - const NamesAndTypesList & alias_columns, - const ColumnDefaults & column_defaults, - const ASTModifier & engine_modifier) + const Context &, + const String &, + const NamesAndTypesList &, + const NamesAndTypesList &, + const NamesAndTypesList &, + const ColumnDefaults &, + const ASTModifier &) { throw Exception("DatabaseDictionary: alterTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } time_t DatabaseDictionary::getTableMetadataModificationTime( - const Context & context, - const String & table_name) + const Context &, + const String &) { return static_cast(0); } ASTPtr DatabaseDictionary::getCreateQuery( - const Context & context, - const String & table_name) const + const Context &, + const String &) const { throw Exception("DatabaseDictionary: getCreateQuery() is not supported", ErrorCodes::NOT_IMPLEMENTED); } diff --git a/dbms/src/Databases/DatabaseMemory.cpp b/dbms/src/Databases/DatabaseMemory.cpp index 5c2adeddbb7..1191339bbeb 100644 --- a/dbms/src/Databases/DatabaseMemory.cpp +++ b/dbms/src/Databases/DatabaseMemory.cpp @@ -14,9 +14,9 @@ namespace ErrorCodes } void DatabaseMemory::loadTables( - Context & context, - ThreadPool * thread_pool, - bool has_force_restore_data_flag) + Context & /*context*/, + ThreadPool * /*thread_pool*/, + bool /*has_force_restore_data_flag*/) { log = &Logger::get("DatabaseMemory(" + name + ")"); @@ -24,7 +24,7 @@ void DatabaseMemory::loadTables( } bool DatabaseMemory::isTableExist( - const Context & context, + const Context & /*context*/, const String & table_name) const { std::lock_guard lock(mutex); @@ -32,7 +32,7 @@ bool DatabaseMemory::isTableExist( } StoragePtr DatabaseMemory::tryGetTable( - const Context & context, + const Context & /*context*/, const String & table_name) { std::lock_guard lock(mutex); @@ -42,13 +42,13 @@ StoragePtr DatabaseMemory::tryGetTable( return it->second; } -DatabaseIteratorPtr DatabaseMemory::getIterator(const Context & context) +DatabaseIteratorPtr DatabaseMemory::getIterator(const Context & /*context*/) { std::lock_guard lock(mutex); return std::make_unique(tables); } -bool DatabaseMemory::empty(const Context & context) const +bool DatabaseMemory::empty(const Context & /*context*/) const { std::lock_guard lock(mutex); return tables.empty(); @@ -77,55 +77,54 @@ void DatabaseMemory::attachTable(const String & table_name, const StoragePtr & t } void DatabaseMemory::createTable( - const Context & context, + const Context & /*context*/, const String & table_name, const StoragePtr & table, - const ASTPtr & query) + const ASTPtr & /*query*/) { attachTable(table_name, table); } void DatabaseMemory::removeTable( - const Context & context, + const Context & /*context*/, const String & table_name) { detachTable(table_name); } void DatabaseMemory::renameTable( - const Context & context, - const String & table_name, - IDatabase & to_database, - const String & to_table_name) + const Context &, + const String &, + IDatabase &, + const String &) { throw Exception("DatabaseMemory: renameTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } void DatabaseMemory::alterTable( - const Context & context, - const String & name, - const NamesAndTypesList & columns, - const NamesAndTypesList & materialized_columns, - const NamesAndTypesList & alias_columns, - const ColumnDefaults & column_defaults, - const ASTModifier & engine_modifier) + const Context &, + const String &, + const NamesAndTypesList &, + const NamesAndTypesList &, + const NamesAndTypesList &, + const ColumnDefaults &, + const ASTModifier &) { throw Exception("DatabaseMemory: alterTable() is not supported", ErrorCodes::NOT_IMPLEMENTED); } time_t DatabaseMemory::getTableMetadataModificationTime( - const Context & context, - const String & table_name) + const Context &, + const String &) { return static_cast(0); } ASTPtr DatabaseMemory::getCreateQuery( - const Context & context, - const String & table_name) const + const Context &, + const String &) const { throw Exception("DatabaseMemory: getCreateQuery() is not supported", ErrorCodes::NOT_IMPLEMENTED); - return nullptr; } void DatabaseMemory::shutdown() diff --git a/dbms/src/Dictionaries/CacheDictionary.cpp b/dbms/src/Dictionaries/CacheDictionary.cpp index f69bc8430b8..6cec19f712a 100644 --- a/dbms/src/Dictionaries/CacheDictionary.cpp +++ b/dbms/src/Dictionaries/CacheDictionary.cpp @@ -93,7 +93,7 @@ void CacheDictionary::toParent(const PaddedPODArray & ids, PaddedPODArray & arr, const size_t idx) { return arr[idx]; } -static inline CacheDictionary::Key getAt(const CacheDictionary::Key & value, const size_t idx) { return value; } +static inline CacheDictionary::Key getAt(const CacheDictionary::Key & value, const size_t) { return value; } template @@ -459,7 +459,7 @@ void CacheDictionary::createAttributes() CacheDictionary::Attribute CacheDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}}; switch (type) { @@ -628,7 +628,7 @@ void CacheDictionary::getItemsNumberImpl( for (const auto row : outdated_ids[id]) out[row] = static_cast(attribute_value); }, - [&] (const auto id, const auto cell_idx) + [&] (const auto id, const auto) { for (const auto row : outdated_ids[id]) out[row] = get_default(row); @@ -750,7 +750,7 @@ void CacheDictionary::getItemsString( map[id] = String{attribute_value}; total_length += (attribute_value.size + 1) * outdated_ids[id].size(); }, - [&] (const auto id, const auto cell_idx) + [&] (const auto id, const auto) { for (const auto row : outdated_ids[id]) total_length += get_default(row).size + 1; diff --git a/dbms/src/Dictionaries/ComplexKeyCacheDictionary_createAttributeWithType.cpp b/dbms/src/Dictionaries/ComplexKeyCacheDictionary_createAttributeWithType.cpp index 43c1c1ff457..809753f6cb6 100644 --- a/dbms/src/Dictionaries/ComplexKeyCacheDictionary_createAttributeWithType.cpp +++ b/dbms/src/Dictionaries/ComplexKeyCacheDictionary_createAttributeWithType.cpp @@ -5,7 +5,7 @@ namespace DB ComplexKeyCacheDictionary::Attribute ComplexKeyCacheDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}}; switch (type) { diff --git a/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp b/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp index 02411001b88..907bb7faf6f 100644 --- a/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp +++ b/dbms/src/Dictionaries/ComplexKeyHashedDictionary.cpp @@ -89,7 +89,7 @@ void ComplexKeyHashedDictionary::getString( const auto & null_value = StringRef{std::get(attribute.null_values)}; getItemsImpl(attribute, key_columns, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return null_value; }); } @@ -136,7 +136,7 @@ void ComplexKeyHashedDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, key_columns, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t row) { return def->getDataAt(row); }); } @@ -183,7 +183,7 @@ void ComplexKeyHashedDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, key_columns, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return StringRef{def}; }); } @@ -333,7 +333,7 @@ void ComplexKeyHashedDictionary::createAttributeImpl(Attribute & attribute, cons ComplexKeyHashedDictionary::Attribute ComplexKeyHashedDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}, {}}; switch (type) { diff --git a/dbms/src/Dictionaries/DictionaryBlockInputStream.h b/dbms/src/Dictionaries/DictionaryBlockInputStream.h index 5902ba704df..8ef6b72cc3d 100644 --- a/dbms/src/Dictionaries/DictionaryBlockInputStream.h +++ b/dbms/src/Dictionaries/DictionaryBlockInputStream.h @@ -201,7 +201,7 @@ template template void DictionaryBlockInputStream::callGetter( DictionaryGetter getter, const PaddedPODArray & ids, - const Columns & keys, const DataTypes & data_types, + const Columns & /*keys*/, const DataTypes & /*data_types*/, Container & container, const DictionaryAttribute & attribute, const DictionaryType & dictionary) const { (dictionary.*getter)(attribute.name, ids, container); @@ -211,7 +211,7 @@ template template void DictionaryBlockInputStream::callGetter( DictionaryStringGetter getter, const PaddedPODArray & ids, - const Columns & keys, const DataTypes & data_types, + const Columns & /*keys*/, const DataTypes & /*data_types*/, Container & container, const DictionaryAttribute & attribute, const DictionaryType & dictionary) const { (dictionary.*getter)(attribute.name, ids, container); @@ -220,7 +220,7 @@ void DictionaryBlockInputStream::callGetter( template template void DictionaryBlockInputStream::callGetter( - GetterByKey getter, const PaddedPODArray & ids, + GetterByKey getter, const PaddedPODArray & /*ids*/, const Columns & keys, const DataTypes & data_types, Container & container, const DictionaryAttribute & attribute, const DictionaryType & dictionary) const { @@ -230,7 +230,7 @@ void DictionaryBlockInputStream::callGetter( template template void DictionaryBlockInputStream::callGetter( - StringGetterByKey getter, const PaddedPODArray & ids, + StringGetterByKey getter, const PaddedPODArray & /*ids*/, const Columns & keys, const DataTypes & data_types, Container & container, const DictionaryAttribute & attribute, const DictionaryType & dictionary) const { diff --git a/dbms/src/Dictionaries/DictionarySourceFactory.cpp b/dbms/src/Dictionaries/DictionarySourceFactory.cpp index 4709a90efde..79f937ca3df 100644 --- a/dbms/src/Dictionaries/DictionarySourceFactory.cpp +++ b/dbms/src/Dictionaries/DictionarySourceFactory.cpp @@ -20,7 +20,10 @@ #include #endif #if Poco_DataODBC_FOUND +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include +#pragma GCC diagnostic pop #include #endif #if USE_MYSQL diff --git a/dbms/src/Dictionaries/Embedded/TechDataHierarchy.cpp b/dbms/src/Dictionaries/Embedded/TechDataHierarchy.cpp index 921b7f5e9ee..741d3833c34 100644 --- a/dbms/src/Dictionaries/Embedded/TechDataHierarchy.cpp +++ b/dbms/src/Dictionaries/Embedded/TechDataHierarchy.cpp @@ -10,7 +10,7 @@ static constexpr auto config_key = "mysql_metrica"; -void TechDataHierarchy::reload(const Poco::Util::AbstractConfiguration & config) +void TechDataHierarchy::reload() { Logger * log = &Logger::get("TechDataHierarchy"); LOG_DEBUG(log, "Loading tech data hierarchy."); diff --git a/dbms/src/Dictionaries/Embedded/TechDataHierarchy.h b/dbms/src/Dictionaries/Embedded/TechDataHierarchy.h index c86d188aa92..060180bcc44 100644 --- a/dbms/src/Dictionaries/Embedded/TechDataHierarchy.h +++ b/dbms/src/Dictionaries/Embedded/TechDataHierarchy.h @@ -19,7 +19,7 @@ private: UInt8 se_parent[256] {}; public: - void reload(const Poco::Util::AbstractConfiguration & config); + void reload(); /// Has corresponding section in configuration file. static bool isConfigured(const Poco::Util::AbstractConfiguration & config); diff --git a/dbms/src/Dictionaries/FileDictionarySource.h b/dbms/src/Dictionaries/FileDictionarySource.h index 48af20951eb..65b1f132025 100644 --- a/dbms/src/Dictionaries/FileDictionarySource.h +++ b/dbms/src/Dictionaries/FileDictionarySource.h @@ -21,13 +21,13 @@ public: BlockInputStreamPtr loadAll() override; - BlockInputStreamPtr loadIds(const std::vector & ids) override + BlockInputStreamPtr loadIds(const std::vector & /*ids*/) override { throw Exception{"Method loadIds is unsupported for FileDictionarySource", ErrorCodes::NOT_IMPLEMENTED}; } BlockInputStreamPtr loadKeys( - const Columns & key_columns, const std::vector & requested_rows) override + const Columns & /*key_columns*/, const std::vector & /*requested_rows*/) override { throw Exception{"Method loadKeys is unsupported for FileDictionarySource", ErrorCodes::NOT_IMPLEMENTED}; } diff --git a/dbms/src/Dictionaries/FlatDictionary.cpp b/dbms/src/Dictionaries/FlatDictionary.cpp index 9706da83acd..72d852c15ce 100644 --- a/dbms/src/Dictionaries/FlatDictionary.cpp +++ b/dbms/src/Dictionaries/FlatDictionary.cpp @@ -59,7 +59,7 @@ void FlatDictionary::toParent(const PaddedPODArray & ids, PaddedPODArray & arr, const size_t idx) { return arr[idx]; } -static inline FlatDictionary::Key getAt(const FlatDictionary::Key & value, const size_t idx) { return value; } +static inline FlatDictionary::Key getAt(const FlatDictionary::Key & value, const size_t) { return value; } template void FlatDictionary::isInImpl( @@ -151,7 +151,7 @@ void FlatDictionary::getString(const std::string & attribute_name, const PaddedP const auto & null_value = std::get(attribute.null_values); getItemsImpl(attribute, ids, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return null_value; }); } @@ -194,7 +194,7 @@ void FlatDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, ids, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t row) { return def->getDataAt(row); }); } @@ -237,7 +237,7 @@ void FlatDictionary::getString( ErrorCodes::TYPE_MISMATCH}; FlatDictionary::getItemsImpl(attribute, ids, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return StringRef{def}; }); } @@ -381,7 +381,7 @@ void FlatDictionary::createAttributeImpl(Attribute & attribute, const Fi FlatDictionary::Attribute FlatDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}, {}}; switch (type) { @@ -519,7 +519,7 @@ const FlatDictionary::Attribute & FlatDictionary::getAttribute(const std::string template -void FlatDictionary::has(const Attribute & attribute, const PaddedPODArray & ids, PaddedPODArray & out) const +void FlatDictionary::has(const Attribute &, const PaddedPODArray & ids, PaddedPODArray & out) const { const auto ids_count = ext::size(ids); diff --git a/dbms/src/Dictionaries/HashedDictionary.cpp b/dbms/src/Dictionaries/HashedDictionary.cpp index 6be003065a6..e126dffc488 100644 --- a/dbms/src/Dictionaries/HashedDictionary.cpp +++ b/dbms/src/Dictionaries/HashedDictionary.cpp @@ -52,7 +52,7 @@ void HashedDictionary::toParent(const PaddedPODArray & ids, PaddedPODArray< /// Allow to use single value in same way as array. static inline HashedDictionary::Key getAt(const PaddedPODArray & arr, const size_t idx) { return arr[idx]; } -static inline HashedDictionary::Key getAt(const HashedDictionary::Key & value, const size_t idx) { return value; } +static inline HashedDictionary::Key getAt(const HashedDictionary::Key & value, const size_t) { return value; } template void HashedDictionary::isInImpl( @@ -148,7 +148,7 @@ void HashedDictionary::getString(const std::string & attribute_name, const Padde const auto & null_value = StringRef{std::get(attribute.null_values)}; getItemsImpl(attribute, ids, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return null_value; }); } @@ -191,7 +191,7 @@ void HashedDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, ids, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t row) { return def->getDataAt(row); }); } @@ -233,7 +233,7 @@ void HashedDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, ids, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return StringRef{def}; }); } @@ -356,7 +356,7 @@ void HashedDictionary::createAttributeImpl(Attribute & attribute, const Field & HashedDictionary::Attribute HashedDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}, {}}; switch (type) { diff --git a/dbms/src/Dictionaries/IDictionary.h b/dbms/src/Dictionaries/IDictionary.h index 6490fdd6833..d99d46b8350 100644 --- a/dbms/src/Dictionaries/IDictionary.h +++ b/dbms/src/Dictionaries/IDictionary.h @@ -81,17 +81,17 @@ struct IDictionary : IDictionaryBase /// Methods for hierarchy. - virtual void isInVectorVector(const PaddedPODArray & child_ids, const PaddedPODArray & ancestor_ids, PaddedPODArray & out) const + virtual void isInVectorVector(const PaddedPODArray & /*child_ids*/, const PaddedPODArray & /*ancestor_ids*/, PaddedPODArray & /*out*/) const { throw Exception("Hierarchy is not supported for " + getName() + " dictionary.", ErrorCodes::NOT_IMPLEMENTED); } - virtual void isInVectorConstant(const PaddedPODArray & child_ids, const Key ancestor_id, PaddedPODArray & out) const + virtual void isInVectorConstant(const PaddedPODArray & /*child_ids*/, const Key /*ancestor_id*/, PaddedPODArray & /*out*/) const { throw Exception("Hierarchy is not supported for " + getName() + " dictionary.", ErrorCodes::NOT_IMPLEMENTED); } - virtual void isInConstantVector(const Key child_id, const PaddedPODArray & ancestor_ids, PaddedPODArray & out) const + virtual void isInConstantVector(const Key /*child_id*/, const PaddedPODArray & /*ancestor_ids*/, PaddedPODArray & /*out*/) const { throw Exception("Hierarchy is not supported for " + getName() + " dictionary.", ErrorCodes::NOT_IMPLEMENTED); } diff --git a/dbms/src/Dictionaries/MongoDBBlockInputStream.cpp b/dbms/src/Dictionaries/MongoDBBlockInputStream.cpp index c71bded7b72..54fefc3c7cc 100644 --- a/dbms/src/Dictionaries/MongoDBBlockInputStream.cpp +++ b/dbms/src/Dictionaries/MongoDBBlockInputStream.cpp @@ -5,9 +5,12 @@ #include #include -#include -#include -#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" + #include + #include + #include +#pragma GCC diagnostic pop #include #include diff --git a/dbms/src/Dictionaries/MongoDBDictionarySource.cpp b/dbms/src/Dictionaries/MongoDBDictionarySource.cpp index 9581efac5a3..eb7378cba01 100644 --- a/dbms/src/Dictionaries/MongoDBDictionarySource.cpp +++ b/dbms/src/Dictionaries/MongoDBDictionarySource.cpp @@ -2,10 +2,15 @@ #if Poco_MongoDB_FOUND #include #include -#include -#include -#include -#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" + #include + #include + #include + #include +#pragma GCC diagnostic pop + #include // only after poco diff --git a/dbms/src/Dictionaries/ODBCBlockInputStream.h b/dbms/src/Dictionaries/ODBCBlockInputStream.h index 076600ee9dd..a9d6cbf02f9 100644 --- a/dbms/src/Dictionaries/ODBCBlockInputStream.h +++ b/dbms/src/Dictionaries/ODBCBlockInputStream.h @@ -4,9 +4,12 @@ #include #include -#include -#include -#include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" + #include + #include + #include +#pragma GCC diagnostic pop #include diff --git a/dbms/src/Dictionaries/ODBCDictionarySource.cpp b/dbms/src/Dictionaries/ODBCDictionarySource.cpp index 74761ca23f6..8e5e7db6df8 100644 --- a/dbms/src/Dictionaries/ODBCDictionarySource.cpp +++ b/dbms/src/Dictionaries/ODBCDictionarySource.cpp @@ -1,6 +1,11 @@ #include #include -#include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" + #include +#pragma GCC diagnostic pop + #include #include #include diff --git a/dbms/src/Dictionaries/RangeHashedDictionary.cpp b/dbms/src/Dictionaries/RangeHashedDictionary.cpp index f55bc0164d1..7afe71f86dc 100644 --- a/dbms/src/Dictionaries/RangeHashedDictionary.cpp +++ b/dbms/src/Dictionaries/RangeHashedDictionary.cpp @@ -188,7 +188,7 @@ void RangeHashedDictionary::createAttributeImpl(Attribute & attribute, const Fie RangeHashedDictionary::Attribute RangeHashedDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}, {}}; switch (type) { diff --git a/dbms/src/Dictionaries/TrieDictionary.cpp b/dbms/src/Dictionaries/TrieDictionary.cpp index 3f4d91ece5a..1417f535b30 100644 --- a/dbms/src/Dictionaries/TrieDictionary.cpp +++ b/dbms/src/Dictionaries/TrieDictionary.cpp @@ -106,7 +106,7 @@ void TrieDictionary::getString( const auto & null_value = StringRef{std::get(attribute.null_values)}; getItemsImpl(attribute, key_columns, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return null_value; }); } @@ -153,7 +153,7 @@ void TrieDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, key_columns, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t row) { return def->getDataAt(row); }); } @@ -200,7 +200,7 @@ void TrieDictionary::getString( ErrorCodes::TYPE_MISMATCH}; getItemsImpl(attribute, key_columns, - [&] (const size_t row, const StringRef value) { out->insertData(value.data, value.size); }, + [&] (const size_t, const StringRef value) { out->insertData(value.data, value.size); }, [&] (const size_t) { return StringRef{def}; }); } @@ -360,7 +360,7 @@ void TrieDictionary::createAttributeImpl(Attribute & attribute, const Field & nu TrieDictionary::Attribute TrieDictionary::createAttributeWithType(const AttributeUnderlyingType type, const Field & null_value) { - Attribute attr{type}; + Attribute attr{type, {}, {}, {}}; switch (type) { @@ -534,7 +534,7 @@ const TrieDictionary::Attribute & TrieDictionary::getAttribute(const std::string } template -void TrieDictionary::has(const Attribute & attribute, const Columns & key_columns, PaddedPODArray & out) const +void TrieDictionary::has(const Attribute &, const Columns & key_columns, PaddedPODArray & out) const { const auto first_column = key_columns.front(); const auto rows = first_column->size(); diff --git a/dbms/src/Functions/FunctionHelpers.h b/dbms/src/Functions/FunctionHelpers.h index fc0235d690b..7b0a06842c8 100644 --- a/dbms/src/Functions/FunctionHelpers.h +++ b/dbms/src/Functions/FunctionHelpers.h @@ -65,7 +65,7 @@ const Type * checkAndGetColumnConstData(const IColumn * column) } template -const bool checkColumnConst(const IColumn * column) +bool checkColumnConst(const IColumn * column) { return checkAndGetColumnConst(column); } diff --git a/dbms/src/Interpreters/Aggregator.cpp b/dbms/src/Interpreters/Aggregator.cpp index 6444336ce18..4c4818d070f 100644 --- a/dbms/src/Interpreters/Aggregator.cpp +++ b/dbms/src/Interpreters/Aggregator.cpp @@ -1141,7 +1141,7 @@ void NO_INLINE Aggregator::convertToBlockImplFinal( *final_aggregate_columns[i]); } - destroyImpl(method, data); /// NOTE You can do better. + destroyImpl(data); /// NOTE You can do better. } template @@ -2430,9 +2430,7 @@ std::vector Aggregator::convertBlockToTwoLevel(const Block & block) template -void NO_INLINE Aggregator::destroyImpl( - Method & method, - Table & table) const +void NO_INLINE Aggregator::destroyImpl(Table & table) const { for (auto elem : table) { @@ -2482,7 +2480,7 @@ void Aggregator::destroyAllAggregateStates(AggregatedDataVariants & result) #define M(NAME, IS_TWO_LEVEL) \ else if (result.type == AggregatedDataVariants::Type::NAME) \ - destroyImpl(*result.NAME, result.NAME->data); + destroyImpl(result.NAME->data); if (false) {} APPLY_FOR_AGGREGATED_VARIANTS(M) diff --git a/dbms/src/Interpreters/Aggregator.h b/dbms/src/Interpreters/Aggregator.h index e76b637a4e9..f9e37df915c 100644 --- a/dbms/src/Interpreters/Aggregator.h +++ b/dbms/src/Interpreters/Aggregator.h @@ -1394,9 +1394,7 @@ protected: std::vector & destinations) const; template - void destroyImpl( - Method & method, - Table & table) const; + void destroyImpl(Table & table) const; void destroyWithoutKey( AggregatedDataVariants & result) const; diff --git a/dbms/src/Interpreters/Cluster.cpp b/dbms/src/Interpreters/Cluster.cpp index 3ef096f9414..f59a9006aa3 100644 --- a/dbms/src/Interpreters/Cluster.cpp +++ b/dbms/src/Interpreters/Cluster.cpp @@ -364,7 +364,7 @@ Cluster::Cluster(const Settings & settings, const std::vector && lock, const String & elem, const String & message) +DDLGuard::DDLGuard(Map & map_, std::mutex & mutex_, std::unique_lock && /*lock*/, const String & elem, const String & message) : map(map_), mutex(mutex_) { bool inserted; diff --git a/dbms/src/Interpreters/EmbeddedDictionaries.cpp b/dbms/src/Interpreters/EmbeddedDictionaries.cpp index 33a9ab5883a..f5567e0a1bc 100644 --- a/dbms/src/Interpreters/EmbeddedDictionaries.cpp +++ b/dbms/src/Interpreters/EmbeddedDictionaries.cpp @@ -84,7 +84,7 @@ bool EmbeddedDictionaries::reloadImpl(const bool throw_on_error, const bool forc return {}; auto dictionary = std::make_unique(); - dictionary->reload(config); + dictionary->reload(); return dictionary; }; diff --git a/libs/libmysqlxx/include/mysqlxx/Pool.h b/libs/libmysqlxx/include/mysqlxx/Pool.h index d3ab7044cde..957d80418bf 100644 --- a/libs/libmysqlxx/include/mysqlxx/Pool.h +++ b/libs/libmysqlxx/include/mysqlxx/Pool.h @@ -150,19 +150,9 @@ public: unsigned max_connections_ = MYSQLXX_POOL_DEFAULT_MAX_CONNECTIONS, const char * parent_config_name_ = nullptr); - /** - * @param db_ Database name - * @param server_ Hostname - * @param user_ User name - * @param password_ Password - * @param socket_ Socket - * @param port_ Port - * @param default_connections_ Number of default connections - * @param max_connections_ Maximum number of connections - * - * Like with mysqlxx::Connection, either port either socket should be specified. - * If server is localhost and socket is not empty, than socket is used. Otherwise, server and port is used. - */ + /** Like with mysqlxx::Connection, either port either socket should be specified. + * If server is localhost and socket is not empty, than socket is used. Otherwise, server and port is used. + */ Pool(const std::string & db_, const std::string & server_, const std::string & user_ = "", @@ -174,7 +164,7 @@ public: unsigned default_connections_ = MYSQLXX_POOL_DEFAULT_START_CONNECTIONS, unsigned max_connections_ = MYSQLXX_POOL_DEFAULT_MAX_CONNECTIONS) : default_connections(default_connections_), max_connections(max_connections_), - db(db_), server(server_), user(user_), password(password_), port(port_), + db(db_), server(server_), user(user_), password(password_), port(port_), socket(socket_), connect_timeout(connect_timeout_), rw_timeout(rw_timeout_) {} Pool(const Pool & other)