diff --git a/src/Storages/MergeTree/KeyCondition.cpp b/src/Storages/MergeTree/KeyCondition.cpp index 79bbc0e7216..970e32f2a70 100644 --- a/src/Storages/MergeTree/KeyCondition.cpp +++ b/src/Storages/MergeTree/KeyCondition.cpp @@ -463,7 +463,7 @@ static Field applyFunctionForField( return (*block.safeGetByPosition(1).column)[0]; } -static FieldRef applyFunction(FunctionBasePtr & func, const DataTypePtr & current_type, const FieldRef & field) +static FieldRef applyFunction(const FunctionBasePtr & func, const DataTypePtr & current_type, const FieldRef & field) { /// Fallback for fields without block reference. if (field.isExplicit()) @@ -1098,10 +1098,10 @@ BoolMask KeyCondition::checkInRange( std::optional KeyCondition::applyMonotonicFunctionsChainToRange( Range key_range, - MonotonicFunctionsChain & functions, + const MonotonicFunctionsChain & functions, DataTypePtr current_type) { - for (auto & func : functions) + for (const auto & func : functions) { /// We check the monotonicity of each function on a specific range. IFunction::Monotonicity monotonicity = func->getMonotonicityForRange( diff --git a/src/Storages/MergeTree/KeyCondition.h b/src/Storages/MergeTree/KeyCondition.h index a37af2d677b..1f2d2f41718 100644 --- a/src/Storages/MergeTree/KeyCondition.h +++ b/src/Storages/MergeTree/KeyCondition.h @@ -306,7 +306,7 @@ public: static std::optional applyMonotonicFunctionsChainToRange( Range key_range, - MonotonicFunctionsChain & functions, + const MonotonicFunctionsChain & functions, DataTypePtr current_type); bool matchesExactContinuousRange() const; @@ -349,7 +349,7 @@ private: using MergeTreeSetIndexPtr = std::shared_ptr; MergeTreeSetIndexPtr set_index; - mutable MonotonicFunctionsChain monotonic_functions_chain; /// The function execution does not violate the constancy. + MonotonicFunctionsChain monotonic_functions_chain; }; using RPN = std::vector;