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)
{
factory.registerFunction<FunctionE>();
factory.registerFunction<FunctionPi>();
factory.registerFunction<FunctionExp>();
factory.registerFunction<FunctionLog>();
factory.registerFunction<FunctionPi>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionExp>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionLog>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionExp2>();
factory.registerFunction<FunctionLog2>();
factory.registerFunction<FunctionLog2>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionExp10>();
factory.registerFunction<FunctionLog10>();
factory.registerFunction<FunctionSqrt>();
factory.registerFunction<FunctionLog10>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionSqrt>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionCbrt>();
factory.registerFunction<FunctionErf>();
factory.registerFunction<FunctionErfc>();
factory.registerFunction<FunctionLGamma>();
factory.registerFunction<FunctionTGamma>();
factory.registerFunction<FunctionSin>();
factory.registerFunction<FunctionCos>();
factory.registerFunction<FunctionTan>();
factory.registerFunction<FunctionAsin>();
factory.registerFunction<FunctionAcos>();
factory.registerFunction<FunctionAtan>();
factory.registerFunction<FunctionPow>();
factory.registerFunction<FunctionSin>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionCos>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionTan>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionAsin>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionAcos>(FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionAtan>(FunctionFactory::CaseInsensitive);
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);