From 32129ca7dcbfc3e7a9150f6c1a1ff31daa8db800 Mon Sep 17 00:00:00 2001 From: Maksim Kita Date: Thu, 19 Jan 2023 10:54:35 +0100 Subject: [PATCH] Fixed build --- .../Passes/ConvertOrLikeChainPass.cpp | 25 ++++++++++--------- src/Analyzer/QueryTreePassManager.cpp | 3 ++- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Analyzer/Passes/ConvertOrLikeChainPass.cpp b/src/Analyzer/Passes/ConvertOrLikeChainPass.cpp index fef6db7a83f..c636e0bdf00 100644 --- a/src/Analyzer/Passes/ConvertOrLikeChainPass.cpp +++ b/src/Analyzer/Passes/ConvertOrLikeChainPass.cpp @@ -27,6 +27,7 @@ namespace class ConvertOrLikeChainVisitor : public InDepthQueryTreeVisitorWithContext { +public: using Base = InDepthQueryTreeVisitorWithContext; using Base::Base; @@ -59,27 +60,27 @@ class ConvertOrLikeChainVisitor : public InDepthQueryTreeVisitorWithContext node_to_patterns; FunctionNodes match_functions; - for (auto & arg : function_node->getArguments()) + for (auto & argument : function_node->getArguments()) { - unique_elems.push_back(arg); + unique_elems.push_back(argument); - auto * arg_func = arg->as(); - if (!arg_func) + auto * argument_function = argument->as(); + if (!argument_function) continue; - const bool is_like = arg_func->getFunctionName() == "like"; - const bool is_ilike = arg_func->getFunctionName() == "ilike"; + const bool is_like = argument_function->getFunctionName() == "like"; + const bool is_ilike = argument_function->getFunctionName() == "ilike"; /// Not {i}like -> bail out. if (!is_like && !is_ilike) continue; - const auto & like_arguments = arg_func->getArguments().getNodes(); + const auto & like_arguments = argument_function->getArguments().getNodes(); if (like_arguments.size() != 2) continue; - auto identifier = like_arguments[0]; - auto * pattern = like_arguments[1]->as(); + const auto & like_first_argument = like_arguments[0]; + const auto * pattern = like_arguments[1]->as(); if (!pattern || !isString(pattern->getResultType())) continue; @@ -90,14 +91,14 @@ class ConvertOrLikeChainVisitor : public InDepthQueryTreeVisitorWithContext("multiMatchAny"); - match_function->getArguments().getNodes().push_back(identifier); + match_function->getArguments().getNodes().push_back(like_first_argument); match_functions.push_back(match_function); unique_elems.push_back(std::move(match_function)); diff --git a/src/Analyzer/QueryTreePassManager.cpp b/src/Analyzer/QueryTreePassManager.cpp index b75226b8f27..0280831a255 100644 --- a/src/Analyzer/QueryTreePassManager.cpp +++ b/src/Analyzer/QueryTreePassManager.cpp @@ -1,6 +1,7 @@ -#include #include +#include + #include #include