IPV4_CIDR_TO_RANGE
IPV4_CIDR_TO_RANGE
IPV4_CIDR_TO_RANGE
Description
Syntax
STRUCT<IPV4, IPV4> IPV4_CIDR_TO_RANGE(IPV4 ip_v4, INT16 cidr)
接收一个IPv4和一个包含CIDR的Int16值。返回一个结构体,其中包含两个IPv4字段分别表示子网的较低范围(min)和较高范围(max)。
Example
mysql> SELECT ipv4_cidr_to_range(ipv4_string_to_num('192.168.5.2'), 16);
+------------------------------------------------------------+
| ipv4_cidr_to_range(ipv4_string_to_num('192.168.5.2'), 16) |
+------------------------------------------------------------+
| {"min": "192.168.0.0", "max": "192.168.255.255"} |
+------------------------------------------------------------+
mysql> SELECT ipv4_cidr_to_range(to_ipv4('192.168.5.2'), 16);
+--------------------------------------------------+
| ipv4_cidr_to_range(to_ipv4('192.168.5.2'), 16) |
+--------------------------------------------------+
| {"min": "192.168.0.0", "max": "192.168.255.255"} |
+--------------------------------------------------+
mysql> SELECT ipv4_cidr_to_range(NULL, NULL);
+--------------------------------+
| ipv4_cidr_to_range(NULL, NULL) |
+--------------------------------+
| NULL |
+--------------------------------+
Keywords
IPV4_CIDR_TO_RANGE, IP