diff --git a/dbms/src/Functions/lower.cpp b/dbms/src/Functions/lower.cpp index 38379fa10cd..4f9dec14602 100644 --- a/dbms/src/Functions/lower.cpp +++ b/dbms/src/Functions/lower.cpp @@ -15,7 +15,8 @@ using FunctionLower = FunctionStringToString, NameLower void registerFunctionLower(FunctionFactory & factory) { - factory.registerFunction(); + factory.registerFunction(FunctionFactory::CaseInsensitive); + factory.registerAlias("lcase", "lower", FunctionFactory::CaseInsensitive); } } diff --git a/dbms/src/Functions/upper.cpp b/dbms/src/Functions/upper.cpp index 9a884ccedd8..35300b61c93 100644 --- a/dbms/src/Functions/upper.cpp +++ b/dbms/src/Functions/upper.cpp @@ -15,7 +15,8 @@ using FunctionUpper = FunctionStringToString, NameUpper void registerFunctionUpper(FunctionFactory & factory) { - factory.registerFunction(); + factory.registerFunction(FunctionFactory::CaseInsensitive); + factory.registerAlias("ucase", "upper", FunctionFactory::CaseInsensitive); } } diff --git a/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.reference b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.reference new file mode 100644 index 00000000000..da7e45c0ca0 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.reference @@ -0,0 +1,4 @@ +foo +FOO +foo +FOO diff --git a/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql new file mode 100644 index 00000000000..63ab4eb56d0 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql @@ -0,0 +1,6 @@ +SET send_logs_level = 'none'; + +select lcase('FOO'); +select ucase('foo'); +select LOWER('Foo'); +select UPPER('Foo');