Declaration
IS_IPV4_COMPAT(expr)
Description
The INET6_ATON() function converts an IPv6 address represented as a numeric value into a binary string.
If the parameter is a valid IPv6 address compatible with IPv4, 1 is returned; otherwise, 0 is returned. The format of an IPv4-compatible address is ::ipv4_address. The IPv4 part of an IPv4-compatible address can also be represented in hexadecimal.
Examples
obclient> SELECT IS_IPV4_COMPAT(INET6_ATON('::10.x.x.x'));
+------------------------------------------+
| IS_IPV4_COMPAT(INET6_ATON('::10.x.x.x')) |
+------------------------------------------+
| 1 |
+------------------------------------------+
1 row in set
obclient> SELECT HEX(INET6_ATON('10.10.10.10'));
+---------------------------------+
| HEX(INET6_ATON('10.10.10.10')) |
+---------------------------------+
| C6336501 |
+---------------------------------+
1 row in set