Added compatibility aliases for "length" and "lengthUTF8" [#CLICKHOUSE-20]

This commit is contained in:
Alexey Milovidov 2018-10-05 22:52:42 +03:00
parent 45af805ccb
commit 9e1c51aca4
4 changed files with 7 additions and 1 deletions

View File

@ -47,7 +47,7 @@ using FunctionLength = FunctionStringOrArrayToT<LengthImpl, NameLength, UInt64>;
void registerFunctionLength(FunctionFactory & factory)
{
factory.registerFunction<FunctionLength>();
factory.registerFunction<FunctionLength>(FunctionFactory::CaseInsensitive);
}
}

View File

@ -63,6 +63,10 @@ using FunctionLengthUTF8 = FunctionStringOrArrayToT<LengthUTF8Impl, NameLengthUT
void registerFunctionLengthUTF8(FunctionFactory & factory)
{
factory.registerFunction<FunctionLengthUTF8>();
/// Compatibility aliases.
factory.registerFunction<FunctionLengthUTF8>("CHAR_LENGTH", FunctionFactory::CaseInsensitive);
factory.registerFunction<FunctionLengthUTF8>("CHARACTER_LENGTH", FunctionFactory::CaseInsensitive);
}
}

View File

@ -0,0 +1 @@
12 6 6

View File

@ -0,0 +1 @@
SELECT LENGTH('корова'), CHAR_LENGTH('ворона'), CHARACTER_LENGTH('фейхоа');