TO_IPV6_OR_NULL

SinceVersion dev

TO_IPV6_OR_NULL

description

Syntax

IPV6 TO_IPV6_OR_NULL(STRING ipv6_str)

Same as to_ipv6, but if the IPv6 address has an invalid format, it returns NULL.

notice

If input is NULL, return NULL.

example

  1. mysql> select to_ipv6_or_null('.');
  2. +----------------------+
  3. | to_ipv6_or_null('.') |
  4. +----------------------+
  5. | NULL |
  6. +----------------------+
  7. mysql> select to_ipv6_or_null(NULL);
  8. +-----------------------+
  9. | to_ipv6_or_null(NULL) |
  10. +-----------------------+
  11. | NULL |
  12. +-----------------------+

keywords

TO_IPV6_OR_NULL, IP