diff options
Diffstat (limited to 'plugin/type_inet/sql_type_inet.cc')
-rw-r--r-- | plugin/type_inet/sql_type_inet.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/plugin/type_inet/sql_type_inet.cc b/plugin/type_inet/sql_type_inet.cc index b8d2ef706a9..3d499620780 100644 --- a/plugin/type_inet/sql_type_inet.cc +++ b/plugin/type_inet/sql_type_inet.cc @@ -44,7 +44,7 @@ static const char HEX_DIGITS[]= "0123456789abcdef"; IPv4-part differently on different platforms. */ -bool Inet4::ascii_to_ipv4(const char *str, size_t str_length) +bool Inet4::ascii_to_fbt(const char *str, size_t str_length) { if (str_length < 7) { @@ -259,8 +259,9 @@ bool Inet6::ascii_to_fbt(const char *str, size_t str_length) return true; } - Inet4_null tmp(group_start_ptr, (size_t) (str_end - group_start_ptr), - &my_charset_latin1); + Inet4Bundle::Fbt_null tmp(group_start_ptr, + (size_t) (str_end - group_start_ptr), + &my_charset_latin1); if (tmp.is_null()) { DBUG_PRINT("error", ("ascii_to_ipv6(%.*s): invalid IPv6 address: " @@ -268,7 +269,7 @@ bool Inet6::ascii_to_fbt(const char *str, size_t str_length) return true; } - tmp.to_binary(dst, IN_ADDR_SIZE); + tmp.to_record(dst, IN_ADDR_SIZE); dst += IN_ADDR_SIZE; chars_in_group= 0; @@ -483,7 +484,7 @@ size_t Inet6::to_string(char *dst, size_t dstsize) const // the string (dst). Now it's time to dump IPv4-part. return (size_t) (p - dst) + - Inet4_null((const char *) (ipv6_bytes + 12), 4). + Inet4((const char *) (ipv6_bytes + 12), 4). to_string(p, dstsize_available); } else @@ -512,3 +513,9 @@ const Name &Inet6::default_value() static Name def(STRING_WITH_LEN("::")); return def; } + +const Name &Inet4::default_value() +{ + static Name def(STRING_WITH_LEN("0.0.0.0")); + return def; +} |