mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Use registerAlias for mysql comatibility of ntoa/aton functions
This commit is contained in:
parent
f79699df7b
commit
4cf2e33647
@ -8,7 +8,6 @@ namespace DB
|
||||
struct NameFunctionIPv4NumToString { static constexpr auto name = "IPv4NumToString"; };
|
||||
struct NameFunctionIPv4NumToStringClassC { static constexpr auto name = "IPv4NumToStringClassC"; };
|
||||
|
||||
|
||||
void registerFunctionsCoding(FunctionFactory & factory)
|
||||
{
|
||||
factory.registerFunction<FunctionToStringCutToZero>();
|
||||
@ -29,20 +28,16 @@ void registerFunctionsCoding(FunctionFactory & factory)
|
||||
|
||||
factory.registerFunction<FunctionIPv4NumToString<0, NameFunctionIPv4NumToString>>();
|
||||
factory.registerFunction<FunctionIPv4NumToString<1, NameFunctionIPv4NumToStringClassC>>();
|
||||
/// MysQL compatibility alias.
|
||||
factory.registerFunction<FunctionIPv4NumToString<0, NameFunctionIPv4NumToString>>("INET_NTOA", FunctionFactory::CaseInsensitive);
|
||||
|
||||
factory.registerFunction<FunctionIPv4StringToNum>();
|
||||
/// MysQL compatibility alias.
|
||||
factory.registerFunction<FunctionIPv4StringToNum>("INET_ATON", FunctionFactory::CaseInsensitive);
|
||||
|
||||
factory.registerFunction<FunctionIPv6NumToString>();
|
||||
/// MysQL compatibility alias.
|
||||
factory.registerFunction<FunctionIPv6NumToString>("INET6_NTOA", FunctionFactory::CaseInsensitive);
|
||||
|
||||
factory.registerFunction<FunctionIPv6StringToNum>();
|
||||
/// MysQL compatibility alias.
|
||||
factory.registerFunction<FunctionIPv6StringToNum>("INET6_ATON", FunctionFactory::CaseInsensitive);
|
||||
|
||||
/// MysQL compatibility aliases:
|
||||
factory.registerAlias("INET_ATON", FunctionIPv4StringToNum::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET6_NTOA", FunctionIPv6NumToString::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET6_ATON", FunctionIPv6StringToNum::name, FunctionFactory::CaseInsensitive);
|
||||
factory.registerAlias("INET_NTOA", NameFunctionIPv4NumToString::name, FunctionFactory::CaseInsensitive);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
2a02:6b8::11
|
||||
2A0206B8000000000000000000000011
|
||||
0.0.5.57
|
||||
3232235521
|
@ -0,0 +1,4 @@
|
||||
SELECT INET6_NTOA(toFixedString(unhex('2A0206B8000000000000000000000011'), 16));
|
||||
SELECT hex(INET6_ATON('2a02:6b8::11'));
|
||||
SELECT INET_NTOA(toUInt32(1337));
|
||||
SELECT INET_ATON('192.168.0.1');
|
@ -1 +0,0 @@
|
||||
2a02:6b8::11
|
@ -1 +0,0 @@
|
||||
SELECT INET6_NTOA(toFixedString(unhex('2A0206B8000000000000000000000011'), 16));
|
@ -1 +0,0 @@
|
||||
*И\0\0\0\0\0\0\0\0\0\0\0
|
@ -1 +0,0 @@
|
||||
SELECT INET6_ATON('2a02:6b8::11');
|
@ -1 +0,0 @@
|
||||
0.0.5.57
|
@ -1 +0,0 @@
|
||||
SELECT INET_NTOA(toUInt32(1337));
|
@ -1 +0,0 @@
|
||||
3232235521
|
@ -1 +0,0 @@
|
||||
SELECT INET_ATON('192.168.0.1');
|
Loading…
Reference in New Issue
Block a user