From ed04453122fbb60a1d119c0dc347d18c155c3a85 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Thu, 6 Dec 2018 16:36:23 +0300 Subject: [PATCH] Add locate -> position alias #3713 --- dbms/src/Functions/FunctionsStringSearch.cpp | 1 + .../0_stateless/00765_sql_compatibility_aliases.reference | 1 + .../queries/0_stateless/00765_sql_compatibility_aliases.sql | 1 + 3 files changed, 3 insertions(+) diff --git a/dbms/src/Functions/FunctionsStringSearch.cpp b/dbms/src/Functions/FunctionsStringSearch.cpp index 786831f79bd..337edbbc168 100644 --- a/dbms/src/Functions/FunctionsStringSearch.cpp +++ b/dbms/src/Functions/FunctionsStringSearch.cpp @@ -1088,6 +1088,7 @@ void registerFunctionsStringSearch(FunctionFactory & factory) factory.registerFunction(); factory.registerFunction(); factory.registerFunction(); + factory.registerAlias("locate", NamePosition::name, FunctionFactory::CaseInsensitive); factory.registerAlias("replace", NameReplaceAll::name, 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 index d083f66aef3..439957db622 100644 --- a/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.reference +++ b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.reference @@ -3,3 +3,4 @@ FOO foo FOO baz +2 diff --git a/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql index 2ba51889f3a..791231b9598 100644 --- a/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql +++ b/dbms/tests/queries/0_stateless/00765_sql_compatibility_aliases.sql @@ -5,3 +5,4 @@ select ucase('foo'); select LOWER('Foo'); select UPPER('Foo'); select REPLACE('bar', 'r', 'z'); +select Locate('foo', 'o');