TO_IPV6_OR_DEFAULT

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