Merge pull request #3763 from yandex/missing-sql-compatibility-functions

Add lcase/ucase functions + make lower/upper case-insensitive #3715
This commit is contained in:
alexey-milovidov 2018-12-06 03:44:45 +03:00 committed by GitHub
commit 3f45fbbb33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -15,7 +15,8 @@ using FunctionLower = FunctionStringToString<LowerUpperImpl<'A', 'Z'>, NameLower
void registerFunctionLower(FunctionFactory & factory)
{
factory.registerFunction<FunctionLower>();
factory.registerFunction<FunctionLower>(FunctionFactory::CaseInsensitive);
factory.registerAlias("lcase", "lower", FunctionFactory::CaseInsensitive);
}
}

View File

@ -15,7 +15,8 @@ using FunctionUpper = FunctionStringToString<LowerUpperImpl<'a', 'z'>, NameUpper
void registerFunctionUpper(FunctionFactory & factory)
{
factory.registerFunction<FunctionUpper>();
factory.registerFunction<FunctionUpper>(FunctionFactory::CaseInsensitive);
factory.registerAlias("ucase", "upper", FunctionFactory::CaseInsensitive);
}
}

View File

@ -0,0 +1,4 @@
foo
FOO
foo
FOO

View File

@ -0,0 +1,6 @@
SET send_logs_level = 'none';
select lcase('FOO');
select ucase('foo');
select LOWER('Foo');
select UPPER('Foo');