[MDEV-28463] INET6 representation doesn't seem to follow RFC 5952 Created: 2022-05-03  Updated: 2023-03-03

Status: Open
Project: MariaDB Server
Component/s: Data types
Affects Version/s: 10.5.15, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Alessandro Vesely Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: INET6


 Description   

4.2.2. Handling One 16-Bit 0 Field

The symbol "::" MUST NOT be used to shorten just one 16-bit 0 field.
For example, the representation 2001:db8:0:1:1:1:1:1 is correct, but
2001:db8::1:1:1:1:1 is not correct.
https://datatracker.ietf.org/doc/html/rfc5952#section-4.2.2

The single 0 is lost:

MariaDB [test]> create table tin (addr inet6);
Query OK, 0 rows affected (0.354 sec)
 
MariaDB [test]> insert into tin (addr) values ('2a00:1a40:0:119:ed51:8d3:1821:7cd5');
Query OK, 1 row affected (0.072 sec)
 
MariaDB [test]> insert into tin (addr) values ('2a00:1a40:0:0:ed51:8d3:1821:7cd5');
Query OK, 1 row affected (0.037 sec)
 
MariaDB [test]> select * from tin;
+-----------------------------------+
| addr                              |
+-----------------------------------+
| 2a00:1a40::119:ed51:8d3:1821:7cd5 |
| 2a00:1a40::ed51:8d3:1821:7cd5     |
+-----------------------------------+
2 rows in set (0.001 sec)


Generated at Thu Feb 08 10:00:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.