mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-13 01:41:59 +00:00
32 lines
758 B
C++
32 lines
758 B
C++
#include <Functions/FunctionFactory.h>
|
|
#include <Functions/HasSubsequenceImpl.h>
|
|
|
|
#include "Poco/Unicode.h"
|
|
|
|
namespace DB
|
|
{
|
|
namespace
|
|
{
|
|
|
|
struct HasSubsequenceCaseInsensitiveUTF8
|
|
{
|
|
static constexpr bool is_utf8 = true;
|
|
|
|
static int toLowerIfNeed(int code_point) { return Poco::Unicode::toLower(code_point); }
|
|
};
|
|
|
|
struct NameHasSubsequenceCaseInsensitiveUTF8
|
|
{
|
|
static constexpr auto name = "hasSubsequenceCaseInsensitiveUTF8";
|
|
};
|
|
|
|
using FunctionHasSubsequenceCaseInsensitiveUTF8 = HasSubsequenceImpl<NameHasSubsequenceCaseInsensitiveUTF8, HasSubsequenceCaseInsensitiveUTF8>;
|
|
}
|
|
|
|
REGISTER_FUNCTION(hasSubsequenceCaseInsensitiveUTF8)
|
|
{
|
|
factory.registerFunction<FunctionHasSubsequenceCaseInsensitiveUTF8>({}, FunctionFactory::CaseInsensitive);
|
|
}
|
|
|
|
}
|