mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix parsing of IPv6 addresses longer than 39 characters
This commit is contained in:
parent
33938ce469
commit
df0d3c9304
@ -11,7 +11,7 @@
|
||||
constexpr size_t IPV4_BINARY_LENGTH = 4;
|
||||
constexpr size_t IPV6_BINARY_LENGTH = 16;
|
||||
constexpr size_t IPV4_MAX_TEXT_LENGTH = 15; /// Does not count tail zero byte.
|
||||
constexpr size_t IPV6_MAX_TEXT_LENGTH = 39;
|
||||
constexpr size_t IPV6_MAX_TEXT_LENGTH = 45; /// Does not count tail zero byte.
|
||||
|
||||
namespace DB
|
||||
{
|
||||
|
@ -0,0 +1,3 @@
|
||||
0 ::ffff:1.12.12.12
|
||||
1 ::ffff:123.123.123.123
|
||||
2 ::ffff:192.168.100.228
|
10
tests/queries/0_stateless/02243_ipv6_long_parsing.sql
Normal file
10
tests/queries/0_stateless/02243_ipv6_long_parsing.sql
Normal file
@ -0,0 +1,10 @@
|
||||
DROP TABLE IF EXISTS test_table;
|
||||
CREATE TABLE test_table (id UInt64, value IPv6) ENGINE=MergeTree ORDER BY id;
|
||||
|
||||
INSERT INTO test_table VALUES (0, '0000:0000:0000:0000:0000:ffff:1.12.12.12');
|
||||
INSERT INTO test_table VALUES (1, '0000:0000:0000:0000:0000:ffff:123.123.123.123');
|
||||
INSERT INTO test_table VALUES (2, '0000:0000:0000:0000:0000:ffff:192.168.100.228');
|
||||
|
||||
SELECT * FROM test_table ORDER BY id;
|
||||
|
||||
DROP TABLE test_table;
|
Loading…
Reference in New Issue
Block a user