From 532557ecfd463d1e1de6cca6263b9cf526934c34 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 12 Dec 2020 23:47:37 +0300 Subject: [PATCH 1/2] encodeXMLComponent: rename files after #17659 --- .../{encodeXML.cpp => encodeXMLComponent.cpp} | 11 ++++++----- src/Functions/registerFunctionsString.cpp | 4 ++-- src/Functions/ya.make | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) rename src/Functions/{encodeXML.cpp => encodeXMLComponent.cpp} (93%) diff --git a/src/Functions/encodeXML.cpp b/src/Functions/encodeXMLComponent.cpp similarity index 93% rename from src/Functions/encodeXML.cpp rename to src/Functions/encodeXMLComponent.cpp index 75c5d35668f..d839a3a9264 100644 --- a/src/Functions/encodeXML.cpp +++ b/src/Functions/encodeXMLComponent.cpp @@ -3,6 +3,7 @@ #include #include + namespace DB { namespace ErrorCodes @@ -12,12 +13,12 @@ namespace ErrorCodes namespace { - struct EncodeXMLName + struct EncodeXMLComponentName { static constexpr auto name = "encodeXMLComponent"; }; - class FunctionEncodeXMLImpl + class FunctionEncodeXMLComponentImpl { public: static void vector( @@ -132,12 +133,12 @@ namespace } }; - using FunctionEncodeXML = FunctionStringToString; + using FunctionEncodeXMLComponent = FunctionStringToString; } -void registerFunctionEncodeXML(FunctionFactory & factory) +void registerFunctionEncodeXMLComponent(FunctionFactory & factory) { - factory.registerFunction(); + factory.registerFunction(); } } diff --git a/src/Functions/registerFunctionsString.cpp b/src/Functions/registerFunctionsString.cpp index d24a9e1aa9d..426cc8f8d56 100644 --- a/src/Functions/registerFunctionsString.cpp +++ b/src/Functions/registerFunctionsString.cpp @@ -33,7 +33,7 @@ void registerFunctionRegexpQuoteMeta(FunctionFactory &); void registerFunctionNormalizeQuery(FunctionFactory &); void registerFunctionNormalizedQueryHash(FunctionFactory &); void registerFunctionCountMatches(FunctionFactory &); -void registerFunctionEncodeXML(FunctionFactory & factory); +void registerFunctionEncodeXMLComponent(FunctionFactory & factory); #if USE_BASE64 void registerFunctionBase64Encode(FunctionFactory &); @@ -69,7 +69,7 @@ void registerFunctionsString(FunctionFactory & factory) registerFunctionNormalizeQuery(factory); registerFunctionNormalizedQueryHash(factory); registerFunctionCountMatches(factory); - registerFunctionEncodeXML(factory); + registerFunctionEncodeXMLComponent(factory); #if USE_BASE64 registerFunctionBase64Encode(factory); registerFunctionBase64Decode(factory); diff --git a/src/Functions/ya.make b/src/Functions/ya.make index 201b41593f6..12013dd22b6 100644 --- a/src/Functions/ya.make +++ b/src/Functions/ya.make @@ -226,7 +226,7 @@ SRCS( dumpColumnStructure.cpp e.cpp empty.cpp - encodeXML.cpp + encodeXMLComponent.cpp encrypt.cpp endsWith.cpp equals.cpp From ef064696e77aa4d6e9fc72bf3b412145ddaefaf2 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 13 Dec 2020 00:17:37 +0300 Subject: [PATCH 2/2] Add perf test --- tests/performance/encodeXMLComponent.xml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/performance/encodeXMLComponent.xml diff --git a/tests/performance/encodeXMLComponent.xml b/tests/performance/encodeXMLComponent.xml new file mode 100644 index 00000000000..45241941ac3 --- /dev/null +++ b/tests/performance/encodeXMLComponent.xml @@ -0,0 +1,7 @@ + + + test.hits + + + SELECT count() FROM test.hits WHERE NOT ignore(encodeXMLComponent(URL)) +