Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
Under terms of this task, INET4 and INET6 won't support mutual explicit or implicit CAST. That will be done separately when needed.
But INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so later INET4 and INET6 "know" each other, to implement mutual cast.
Attachments
Issue Links
causes
MDEV-30146Change maturity of plugins for January 2023 Releases
Closed
relates to
MDEV-274The data type for IPv6/IPv4 addresses in MariaDB
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 4 byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so INET4 and INET6 "know" each other:
- They should support explicit CAST between each other
- INET6 should be a super type for INET4.
{code:sql}
SELECT COALEACE(inet4_expr,inet6_expr)
{code}
will implicitly cast inet4_expr to INET6 and return a result of the INET6 data type.
{code:sql}
SELECT inet4_expr=inet6_expr)
{code}
will implicitly cast inet4_expr to INET6, then compare in INET6 format.
- They should possibly support implicit CAST between each other in some other cases. The exact list is to be defined.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so INET4 and INET6 "know" each other:
- They should support explicit CAST between each other
- INET6 should be a super type for INET4.
{code:sql}
SELECT COALEACE(inet4_expr,inet6_expr)
{code}
will implicitly cast inet4_expr to INET6 and return a result of the INET6 data type.
{code:sql}
SELECT inet4_expr=inet6_expr)
{code}
will implicitly cast inet4_expr to INET6, then compare in INET6 format.
- They should possibly support implicit CAST between each other in some other cases. The exact list is to be defined.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so INET4 and INET6 "know" each other:
- They should support explicit CAST between each other
- INET6 should be a super type for INET4.
{code:sql}
SELECT COALEACE(inet4_expr,inet6_expr)
{code}
will implicitly cast inet4_expr to INET6 and return a result of the INET6 data type.
{code:sql}
SELECT inet4_expr=inet6_expr)
{code}
will implicitly cast inet4_expr to INET6, then compare in INET6 format.
- They should possibly support implicit CAST between each other in some other cases. The exact list is to be defined.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
Under terms of this task, INET4 and INET6 won't support mutual explicit or implicit CAST. That will be done separately when needed.
But INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so later INET4 and INET6 "know" each other.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
Under terms of this task, INET4 and INET6 won't support mutual explicit or implicit CAST. That will be done separately when needed.
But INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so later INET4 and INET6 "know" each other.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
Under terms of this task, INET4 and INET6 won't support mutual explicit or implicit CAST. That will be done separately when needed.
But INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so later INET4 and INET6 "know" each other, to implement mutual cast.
Do we want inet4->inet6 conversion to work? I think it's what users might expect. But let's have it as a separate task.
Sergei Golubchik
added a comment - commit 1f897b447ec is good, thanks.
Typo: in a couple of places you say "10.0 tests".
Do we want inet4->inet6 conversion to work? I think it's what users might expect. But let's have it as a separate task.
Please find an updated version in bb-10.10-bar-MDEV-23287-inet4.
It was rebased to the latest 10.10 and now returns errors when mixing INET4 with non-compatible types at the preparation time (i.e. before iterating rows) rather than at the execution time (during iterating rows). Also, more MTR tests were added.
Alexander Barkov
added a comment - - edited Please find an updated version in bb-10.10-bar- MDEV-23287 -inet4.
It was rebased to the latest 10.10 and now returns errors when mixing INET4 with non-compatible types at the preparation time (i.e. before iterating rows) rather than at the execution time (during iterating rows). Also, more MTR tests were added.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4-byte binary strings.
The new data type name will be INET4.
Under terms of this task, INET4 and INET6 won't support mutual explicit or implicit CAST. That will be done separately when needed.
But INET4 should be implemented in the same directory with INET6: plugin/type_inet/, so later INET4 and INET6 "know" each other, to implement mutual cast.
Under terms of MDEV-274 we added the INET6 data type, to store IPv6 addresses as 16-byte binary strings.
Let's also add a data type to store IPv4 addresses, as 4\-byte binary strings.
The new data type name will be INET4.
Under terms of this task, INET4 and INET6 won't support mutual explicit or implicit CAST. That will be done separately when needed.
But INET4 should be implemented in the same directory with INET6: plugin/type\_inet/, so later INET4 and INET6 "know" each other, to implement mutual cast.
serg, please review a patch in:
https://github.com/MariaDB/server/tree/bb-10.10-bar-inet4