IS_IPV4_COMPAT

SinceVersion dev

IS_IPV4_COMPAT

description

Syntax

VARCHAR IS_IPV4_COMPAT(INET6_ATON(VARCHAR ipv4_addr))

This function takes an IPv6 address represented in numeric form as a binary string, as returned by INET6_ATON(). It returns 1 if the argument is a valid IPv4-compatible IPv6 address, 0 otherwise (unless expr is NULL, in which case the function returns NULL). IPv4-compatible addresses have the form ::ipv4_address.

example

1. mysql> SELECT IS_IPV4_COMPAT(INET6_ATON('::ffff:10.0.5.9')) AS is_result;
2. +-----------+
3. | is_result |
4. +-----------+
5. |         0 |
6. +-----------+
7. 1 row in set (0.02 sec)

9. mysql> SELECT IS_IPV4_COMPAT(INET6_ATON('::10.0.5.9')) AS is_result;
10. +-----------+
11. | is_result |
12. +-----------+
13. |         1 |
14. +-----------+
15. 1 row in set (0.03 sec)

keywords

IS_IPV4_COMPAT, IP