TO_IPV6_OR_DEFAULT

SinceVersion dev

TO_IPV6_OR_DEFAULT

description

Syntax

IPV6 TO_IPV6_OR_DEFAULT(STRING ipv6_str)

与to_ipv6函数类似,但如果IPv6地址的格式非法,则返回::。

notice

入参ipv6_str如果为NULL,则返回::。

example

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

keywords

TO_IPV6_OR_DEFAULT, IP