Added "POWER" alias to "pow" function; made some math functions case insensitive for compatibility #3638

This commit is contained in:
Alexey Milovidov 2018-11-24 00:14:28 +03:00
parent 6e2a6d9894
commit 954c974507
3 changed files with 17 additions and 13 deletions

View File

@ -11,26 +11,28 @@ const double PiImpl::value = 3.1415926535897932384626433832795028841971693;
void registerFunctionsMath(FunctionFactory & factory) void registerFunctionsMath(FunctionFactory & factory)
{ {
factory.registerFunction<FunctionE>(); factory.registerFunction<FunctionE>();
factory.registerFunction<FunctionPi>(); factory.registerFunction<FunctionPi>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionExp>(); factory.registerFunction<FunctionExp>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionLog>(); factory.registerFunction<FunctionLog>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionExp2>(); factory.registerFunction<FunctionExp2>();
factory.registerFunction<FunctionLog2>(); factory.registerFunction<FunctionLog2>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionExp10>(); factory.registerFunction<FunctionExp10>();
factory.registerFunction<FunctionLog10>(); factory.registerFunction<FunctionLog10>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionSqrt>(); factory.registerFunction<FunctionSqrt>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionCbrt>(); factory.registerFunction<FunctionCbrt>();
factory.registerFunction<FunctionErf>(); factory.registerFunction<FunctionErf>();
factory.registerFunction<FunctionErfc>(); factory.registerFunction<FunctionErfc>();
factory.registerFunction<FunctionLGamma>(); factory.registerFunction<FunctionLGamma>();
factory.registerFunction<FunctionTGamma>(); factory.registerFunction<FunctionTGamma>();
factory.registerFunction<FunctionSin>(); factory.registerFunction<FunctionSin>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionCos>(); factory.registerFunction<FunctionCos>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionTan>(); factory.registerFunction<FunctionTan>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionAsin>(); factory.registerFunction<FunctionAsin>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionAcos>(); factory.registerFunction<FunctionAcos>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionAtan>(); factory.registerFunction<FunctionAtan>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionPow>(); factory.registerFunction<FunctionPow>(FunctionFactory::CaseInsensitive);
factory.registerAlias("power", "pow", FunctionFactory::CaseInsensitive);
} }
} }

View File

@ -0,0 +1 @@
9 9 9 9

View File

@ -0,0 +1 @@
SELECT pow(3, 2), POW(3, 2), power(3, 2), POWER(3, 2);