fix

fix
This commit is contained in:
feng lv 2020-12-09 07:24:36 +00:00
parent e95e443246
commit 91c3de9664
2 changed files with 8 additions and 5 deletions

View File

@ -121,7 +121,7 @@ struct CustomizeAggregateFunctionsSuffixData
void visit(ASTFunction & func, ASTPtr &) const
{
const auto & instance = AggregateFunctionFactory::instance();
if (instance.isAggregateFunctionName(func.name))
if (instance.isAggregateFunctionName(func.name) && !endsWith(func.name, "OrNull"))
{
auto properties = instance.tryGetProperties(func.name);
if (properties && !properties->returns_default_when_only_null)
@ -165,10 +165,13 @@ struct CustomizeAggregateFunctionsMoveSuffixData
const auto & instance = AggregateFunctionFactory::instance();
if (instance.isAggregateFunctionName(func.name))
{
auto properties = instance.tryGetProperties(func.name);
if (properties && !properties->returns_default_when_only_null)
if (endsWith(func.name, "OrNull"))
{
func.name = moveSuffixAhead(func.name);
auto properties = instance.tryGetProperties(func.name);
if (properties && !properties->returns_default_when_only_null)
{
func.name = moveSuffixAhead(func.name);
}
}
}
}

View File

@ -2,7 +2,7 @@
0
0
0
\N
0
1
\N
\N