diff --git a/src/Core/Field.cpp b/src/Core/Field.cpp index a3324566c3a..de0c9155266 100644 --- a/src/Core/Field.cpp +++ b/src/Core/Field.cpp @@ -522,6 +522,11 @@ template <> bool decimalEqual(Decimal128 x, Decimal128 y, UInt32 x_scale, UInt32 template <> bool decimalLess(Decimal128 x, Decimal128 y, UInt32 x_scale, UInt32 y_scale) { return decLess(x, y, x_scale, y_scale); } template <> bool decimalLessOrEqual(Decimal128 x, Decimal128 y, UInt32 x_scale, UInt32 y_scale) { return decLessOrEqual(x, y, x_scale, y_scale); } +inline void writeText(const Null &, WriteBuffer & buf) +{ + writeText(std::string("Null"), buf); +} + String toString(const Field & x) { return Field::dispatch( diff --git a/src/Core/Field.h b/src/Core/Field.h index a3409d860fd..fa7b03999a2 100644 --- a/src/Core/Field.h +++ b/src/Core/Field.h @@ -873,14 +873,6 @@ inline void writeText(const DecimalField & value, WriteBuffer & buf) writeText(value.getValue(), value.getScale(), buf); } -void writeText(const std::string &, WriteBuffer & buf); - -inline void writeText(const Null &, WriteBuffer & buf) -{ - writeText(std::string("Null"), buf); -} - - template void readQuoted(DecimalField & x, ReadBuffer & buf); diff --git a/src/Dictionaries/getDictionaryConfigurationFromAST.cpp b/src/Dictionaries/getDictionaryConfigurationFromAST.cpp index 98744505c73..b3db806ca5e 100644 --- a/src/Dictionaries/getDictionaryConfigurationFromAST.cpp +++ b/src/Dictionaries/getDictionaryConfigurationFromAST.cpp @@ -112,7 +112,7 @@ void buildLayoutConfiguration( { throw DB::Exception(ErrorCodes::BAD_ARGUMENTS, "Dictionary layout parameter value must be a literal, got '{}' instead", - pair->second ? pair->second->formatForErrorMessage() : ""); + pair->second->formatForErrorMessage()); } const auto value_field = value_literal->value; diff --git a/src/Parsers/ASTFunctionWithKeyValueArguments.h b/src/Parsers/ASTFunctionWithKeyValueArguments.h index 1cd323b72d9..0e0c31b14e4 100644 --- a/src/Parsers/ASTFunctionWithKeyValueArguments.h +++ b/src/Parsers/ASTFunctionWithKeyValueArguments.h @@ -15,7 +15,7 @@ public: /// Name or key of pair String first; /// Value of pair, which can be also list of pairs - IAST * second; + IAST * second = nullptr; /// Value is closed in brackets (HOST '127.0.0.1') bool second_with_brackets; diff --git a/src/Parsers/tests/gtest_dictionary_parser.cpp b/src/Parsers/tests/gtest_dictionary_parser.cpp index b5a0f16d5d2..d1ec5088482 100644 --- a/src/Parsers/tests/gtest_dictionary_parser.cpp +++ b/src/Parsers/tests/gtest_dictionary_parser.cpp @@ -74,7 +74,7 @@ TEST(ParserDictionaryDDL, SimpleDictionary) /// layout test auto * layout = create->dictionary->layout; EXPECT_EQ(layout->layout_type, "flat"); - EXPECT_EQ(layout->children.size(), 0); + EXPECT_EQ(layout->parameters->children.size(), 0); /// lifetime test auto * lifetime = create->dictionary->lifetime;