Add lcase/ucase + make lower/upper case-insensitive #3715

This commit is contained in:
Ivan Blinkov 2018-12-05 19:59:35 +03:00
parent 5da33f04c9
commit e110d0789f
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');