[MDEV-27563] Add MAC Address datatype (macaddr/macaddr8) Created: 2022-01-21  Updated: 2022-01-21

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Trevor Gross Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: datatype, ipv6


 Description   

Mariadb should implement the column data type macaddr, possibly also macaddr8 (EUI-64 format). These are not currently supported in MySQL but are stored commonly enough that it makes sense to support them.

Basic implementation steps are simple:

  • Support inserting as strings (e.g. '0a:0a:0a:0a:0a:0a', '0a-0a-0a-0a-0a-0a' or '0a0a0a0a0a0a') or as hex, similar to the UUID column type
  • Add a typecheck - macaddr8 should allow standard mac addresses or EUI-64
  • Select in standard format with colon separators

For compatibility with PG, trunc() should set the last 3 bytes of a macaddr to 0, or the last 5 bytes if macaddr8, and macaddr8_set7bit() should set bit 7 to one (for ipv6 address usage). Their reference is here: https://www.postgresql.org/docs/14/functions-net.html


Generated at Thu Feb 08 09:53:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.