mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Use offsets in FunctionIPv6StringToNum for copying ipv4 to buffer
This commit is contained in:
parent
419c916612
commit
5cb99ae699
@ -311,7 +311,7 @@ public:
|
||||
std::memcpy(
|
||||
src_ipv4_buf + std::strlen("::ffff:"),
|
||||
reinterpret_cast<const char *>(&vec_src[src_offset]),
|
||||
std::strlen(reinterpret_cast<const char *>(&vec_src[src_offset])));
|
||||
std::min(offsets_src[i] - src_offset, IPV4_MAX_TEXT_LENGTH + 1));
|
||||
parseIPv6(src_ipv4_buf, reinterpret_cast<unsigned char *>(&vec_res[out_offset]));
|
||||
}
|
||||
else
|
||||
|
@ -62,3 +62,6 @@ FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF is ipv6 string: 1
|
||||
::ffff:127.0.0.7
|
||||
::ffff:127.0.0.8
|
||||
::ffff:127.0.0.9
|
||||
::ffff:127.0.0.10
|
||||
::ffff:127.0.0.11
|
||||
::ffff:127.0.0.12
|
||||
|
@ -89,4 +89,4 @@ SELECT '2001:0DB8:AC10:FE01:FEED:BABE:CAFE:F00D is ipv6 string: ', isIPv6String(
|
||||
SELECT toIPv6('0.0.0.0');
|
||||
SELECT toIPv6('127.0.0.1');
|
||||
SELECT cutIPv6(IPv6StringToNum('127.0.0.1'), 0, 0);
|
||||
SELECT toIPv6('127.0.0.' || toString(number)) FROM numbers(10);
|
||||
SELECT toIPv6('127.0.0.' || toString(number)) FROM numbers(13);
|
||||
|
Loading…
Reference in New Issue
Block a user