Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-274

The data type for IPv6/IPv4 addresses in MariaDB

    Details

    • Type: Task
    • Status: Stalled
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • Labels:
      None

      Description

      MariaDB will support the data type to store IPv6 addresses in table columns.
      IPv4 addresses will be also supported by this type assuming conventional mapping of IPv4 addresses into IPv6 addresses

      The objects of the IPv6 type can be used in any context where other MySQL data types are used.
      All comparison operators over operands of this data type will be supported.
      Also the basic function specific for this type will be supported.

      The internal representation of the values of this type will support the conventional compression used for IPv6 addresses when any group of 4 hexadecimal '0000' is represented by one hexadecimal '0'.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              monty Michael Widenius added a comment -

              The IPV6 type should work as follows:

              • Stored as a 16 byte high-byte first binary string (to make comparisons easy)
              • Storage in the field should be done as a normal ipv6 format.
              • Retrieval will be done by returning a full unpacked ipv6 format. (To allow one to do comparisons as string).
              • We will add a ipv6_compact() function to change an ipv6 string to the compact format.

              Example:
              CREATE TABLE t1 (a ipv6);
              insert into t1 values ("2001:0db8:0000:0000:0000:ff00:0042:8329"), ("2001:0db8::ff00:0042:8329");
              select a, ipv6_compact(a) from t1;
              a ipv6_compact(a) from t1;
              "2001:0db8:0000:0000:0000:ff00:0042:8329" "2001:0db8::ff00:0042:8329"
              "2001:0db8:0000:0000:0000:ff00:0042:8329" "2001:0db8::ff00:0042:8329"

              Show
              monty Michael Widenius added a comment - The IPV6 type should work as follows: Stored as a 16 byte high-byte first binary string (to make comparisons easy) Storage in the field should be done as a normal ipv6 format. Retrieval will be done by returning a full unpacked ipv6 format. (To allow one to do comparisons as string). We will add a ipv6_compact() function to change an ipv6 string to the compact format. Example: CREATE TABLE t1 (a ipv6); insert into t1 values ("2001:0db8:0000:0000:0000:ff00:0042:8329"), ("2001:0db8::ff00:0042:8329"); select a, ipv6_compact(a) from t1; a ipv6_compact(a) from t1; "2001:0db8:0000:0000:0000:ff00:0042:8329" "2001:0db8::ff00:0042:8329" "2001:0db8:0000:0000:0000:ff00:0042:8329" "2001:0db8::ff00:0042:8329"
              Hide
              rspadim roberto spadim added a comment -

              please check if we should consider this one a "blocked by" MDEV-4912, or if we will implement this as a "native" field type

              Show
              rspadim roberto spadim added a comment - please check if we should consider this one a "blocked by" MDEV-4912 , or if we will implement this as a "native" field type
              Hide
              devzone.my Aleai Sumity added a comment - - edited

              Need datatype universal
              store IPv4, IPv6, and MAC addresses
              _________________________________
              Name | Storage Size | Description
              cidr | 7 or 19 bytes | IPv4 and IPv6 networks
              inet | 7 or 19 bytes | IPv4 and IPv6 hosts and networks
              macaddr | 6 bytes | MAC addresses

              http://www.postgresql.org/docs/9.3/static/datatype-net-types.html

              Show
              devzone.my Aleai Sumity added a comment - - edited Need datatype universal store IPv4, IPv6, and MAC addresses _________________________________ Name | Storage Size | Description cidr | 7 or 19 bytes | IPv4 and IPv6 networks inet | 7 or 19 bytes | IPv4 and IPv6 hosts and networks macaddr | 6 bytes | MAC addresses http://www.postgresql.org/docs/9.3/static/datatype-net-types.html

                People

                • Assignee:
                  bar Alexander Barkov
                  Reporter:
                  igor Igor Babaev
                • Votes:
                  17 Vote for this issue
                  Watchers:
                  16 Start watching this issue

                  Dates

                  • Created:
                    Updated:

                    Time Tracking

                    Estimated:
                    Original Estimate - 3 weeks Original Estimate - 3 weeks
                    3w
                    Remaining:
                    Time Spent - 6 hours Remaining Estimate - 2 weeks, 4 days, 4 hours
                    2w 4d 4h
                    Logged:
                    Time Spent - 6 hours Remaining Estimate - 2 weeks, 4 days, 4 hours
                    6h