2020-03-29 17:04:16 +00:00
|
|
|
#include "FunctionsStringSearch.h"
|
|
|
|
#include "FunctionFactory.h"
|
|
|
|
#include "PositionImpl.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
2020-09-07 18:00:37 +00:00
|
|
|
namespace
|
|
|
|
{
|
2020-03-29 17:04:16 +00:00
|
|
|
|
|
|
|
struct NamePosition
|
|
|
|
{
|
|
|
|
static constexpr auto name = "position";
|
|
|
|
};
|
|
|
|
|
|
|
|
using FunctionPosition = FunctionsStringSearch<PositionImpl<PositionCaseSensitiveASCII>, NamePosition>;
|
|
|
|
|
2020-09-07 18:00:37 +00:00
|
|
|
}
|
|
|
|
|
2020-03-29 17:04:16 +00:00
|
|
|
void registerFunctionPosition(FunctionFactory & factory)
|
|
|
|
{
|
|
|
|
factory.registerFunction<FunctionPosition>(FunctionFactory::CaseInsensitive);
|
|
|
|
factory.registerAlias("locate", NamePosition::name, FunctionFactory::CaseInsensitive);
|
|
|
|
}
|
|
|
|
}
|