IS_IPV6
Declaration
IS_IPV6(expr)
Description
If the expr parameter is a valid IPv6 address string, it returns 1. Otherwise, it returns 0. This function does not consider IPv4 addresses as valid IPv6 addresses.
For the specified parameter, if IS_IPV6() returns 1, then INET6_ATON() returns a non-NULL value.
Examples
SELECT IS_IPV6('10.x.x.x'), IS_IPV6('::1');
+---------------------+----------------+
| IS_IPV6('10.x.x.x') | IS_IPV6('::1') |
+---------------------+----------------+
| 0 | 1 |
+---------------------+----------------+
1 row in set (0.001 sec)