Syntax
IS_IPV4_COMPAT(expr)
Purpose
You can call this function to convert a numeric IPv6 address to a binary string, which is returned by the INET6_ATON() function.
It returns 1 if the argument is a valid IPv6 address that is compatible with IPv4, and returns 0 if otherwise. The format of an IPv4-compatible IPv6 address is ::ipv4_address. In an IPv4-compatible IPv6 address, the IPv4 address can also be represented in hexadecimal format.
Examples
obclient> SELECT IS_IPV4_COMPAT(INET6_ATON('::10.0.5.7'));
+------------------------------------------+
| IS_IPV4_COMPAT(INET6_ATON('::10.0.5.7')) |
+------------------------------------------+
| 1 |
+------------------------------------------+
1 row in set
obclient> SELECT HEX(INET6_ATON('198.51.101.1'));
+---------------------------------+
| HEX(INET6_ATON('198.51.101.1')) |
+---------------------------------+
| C6336501 |
+---------------------------------+
1 row in set