TO_IPV6_OR_DEFAULT
TO_IPV6_OR_DEFAULTβ
TO_IPV6_OR_DEFAULT
Descriptionβ
Syntaxβ
IPV6 TO_IPV6_OR_DEFAULT(STRING ipv6_str)
Same as to_ipv6, but if the IPv6 address has an invalid format, it returns :: (0 as IPv6).
Noticeβ
If input is NULL, return :: (0 as IPv6).
Exampleβ
mysql> select to_ipv6_or_default('.');
+-------------------------+
| to_ipv6_or_default('.') |
+-------------------------+
| :: |
+-------------------------+
mysql> select to_ipv6_or_default(NULL);
+--------------------------+
| to_ipv6_or_default(NULL) |
+--------------------------+
| :: |
+--------------------------+
Keywordsβ
TO_IPV6_OR_DEFAULT, IP