This commit is contained in:
kssenii 2022-12-07 11:26:32 +01:00
parent 862da8f459
commit 3725cf4aa7

View File

@ -329,11 +329,8 @@ using ExistsExpressionVisitor = InDepthNodeVisitor<OneTypeMatcher<ExistsExpressi
struct ReplacePositionalArgumentsData
{
using TypeToVisit = ASTSelectQuery;
ContextPtr context;
void visit(ASTSelectQuery & select_query, ASTPtr &) const
{
if (context->getSettingsRef().enable_positional_arguments)
static void visit(ASTSelectQuery & select_query, ASTPtr &)
{
if (select_query.groupBy())
{
@ -354,7 +351,6 @@ struct ReplacePositionalArgumentsData
replaceForPositionalArguments(expr, &select_query, ASTSelectQuery::Expression::LIMIT_BY);
}
}
}
};
using ReplacePositionalArgumentsVisitor = InDepthNodeVisitor<OneTypeMatcher<ReplacePositionalArgumentsData>, false>;
@ -1508,8 +1504,11 @@ void TreeRewriter::normalize(
ExistsExpressionVisitor::Data exists;
ExistsExpressionVisitor(exists).visit(query);
ReplacePositionalArgumentsVisitor::Data data_replace_positional_arguments{context_};
if (context_->getSettingsRef().enable_positional_arguments)
{
ReplacePositionalArgumentsVisitor::Data data_replace_positional_arguments;
ReplacePositionalArgumentsVisitor(data_replace_positional_arguments).visit(query);
}
if (settings.transform_null_in)
{