Fix inconsistent formatting of operator function and nulls action

This commit is contained in:
Alexey Milovidov 2024-02-23 15:22:21 +01:00
parent 75c5b1a2c6
commit 396402a9b6
4 changed files with 2 additions and 7 deletions

View File

@ -813,8 +813,7 @@ void ASTFunction::formatImplWithoutAlias(const FormatSettings & settings, Format
/// Should this function to be written as operator?
bool written = false;
if (arguments && !parameters)
if (arguments && !parameters && nulls_action == NullsAction::EMPTY)
{
/// Unary prefix operators.
if (arguments->children.size() == 1)

View File

@ -1,6 +1,5 @@
#include <Databases/DatabaseReplicatedHelpers.h>
#include <Storages/MergeTree/MergeTreeIndexMinMax.h>
#include <Storages/MergeTree/MergeTreeIndexSet.h>
#include <Storages/MergeTree/MergeTreeIndices.h>
#include <Storages/StorageFactory.h>
#include <Storages/StorageMergeTree.h>
@ -9,16 +8,12 @@
#include <Common/Macros.h>
#include <Common/OptimizedRegularExpression.h>
#include <Common/typeid_cast.h>
#include <Common/thread_local_rng.h>
#include <Parsers/ASTCreateQuery.h>
#include <Parsers/ASTExpressionList.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTSetQuery.h>
#include <AggregateFunctions/AggregateFunctionFactory.h>
#include <AggregateFunctions/parseAggregateFunctionParameters.h>
#include <Interpreters/Context.h>
#include <Interpreters/FunctionNameNormalizer.h>

View File

@ -0,0 +1 @@
SELECT plus(1, 1) RESPECT NULLS; -- { serverError SYNTAX_ERROR }