From 9a370a03ef19e6e306e479cd5f7ac445a67fad75 Mon Sep 17 00:00:00 2001 From: feng lv Date: Thu, 10 Sep 2020 15:36:38 +0800 Subject: [PATCH] fix fix --- src/Functions/FunctionsStringHash.h | 1 - src/Functions/bitHammingDistance.cpp | 7 +++---- src/Functions/tupleHammingDistance.cpp | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Functions/FunctionsStringHash.h b/src/Functions/FunctionsStringHash.h index 64ee7f9fe59..19fea2d4fc6 100644 --- a/src/Functions/FunctionsStringHash.h +++ b/src/Functions/FunctionsStringHash.h @@ -15,7 +15,6 @@ namespace DB namespace ErrorCodes { extern const int ILLEGAL_TYPE_OF_ARGUMENT; - extern const int TOO_LARGE_STRING_SIZE; } // FunctionStringHash diff --git a/src/Functions/bitHammingDistance.cpp b/src/Functions/bitHammingDistance.cpp index cb79b498aa6..cb34634b00d 100644 --- a/src/Functions/bitHammingDistance.cpp +++ b/src/Functions/bitHammingDistance.cpp @@ -97,8 +97,7 @@ public: { const auto * left_generic = block.getByPosition(arguments[0]).type.get(); const auto * right_generic = block.getByPosition(arguments[1]).type.get(); - bool valid = castBothTypes(left_generic, right_generic, [&](const auto & left, const auto & right) - { + bool valid = castBothTypes(left_generic, right_generic, [&](const auto & left, const auto & right) { using LeftDataType = std::decay_t; using RightDataType = std::decay_t; using T0 = typename LeftDataType::FieldType; @@ -109,8 +108,8 @@ public: using OpImpl = BitHammingDistanceImpl; - const auto col_left_raw = block.getByPosition(arguments[0]).column.get(); - const auto col_right_raw = block.getByPosition(arguments[1]).column.get(); + const auto * const col_left_raw = block.getByPosition(arguments[0]).column.get(); + const auto * const col_right_raw = block.getByPosition(arguments[1]).column.get(); typename ColVecResult::MutablePtr col_res = nullptr; col_res = ColVecResult::create(); diff --git a/src/Functions/tupleHammingDistance.cpp b/src/Functions/tupleHammingDistance.cpp index 2f0475f3a6c..aa38426d228 100644 --- a/src/Functions/tupleHammingDistance.cpp +++ b/src/Functions/tupleHammingDistance.cpp @@ -106,8 +106,8 @@ public: const ColumnWithTypeAndName & arg2 = block.getByPosition(arguments[1]); const DataTypeTuple & type1 = static_cast(*arg1.type); const DataTypeTuple & type2 = static_cast(*arg2.type); - auto & left_elems = type1.getElements(); - auto & right_elems = type2.getElements(); + const auto & left_elems = type1.getElements(); + const auto & right_elems = type2.getElements(); if (left_elems.size() != 2 || right_elems.size() != 2) throw Exception( "Illegal column of arguments of function " + getName() + ", tuple should have exactly two elements.",