diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-11-07 21:57:42 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-11-07 21:57:42 +0400 |
commit | ca695888e00a4bdace1bc2143d91a0a871f39a6b (patch) | |
tree | 55682e8170e5c80805f0183aa652915ef8390cea /sql/item_inetfunc.cc | |
parent | 6a524fcfdde539c6448aa4126ccb5ed79055b9ce (diff) | |
download | mariadb-git-ca695888e00a4bdace1bc2143d91a0a871f39a6b.tar.gz |
MDEV-14116 INET6_NTOA output is set as null to varchar(39) variable
Diffstat (limited to 'sql/item_inetfunc.cc')
-rw-r--r-- | sql/item_inetfunc.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/item_inetfunc.cc b/sql/item_inetfunc.cc index 6a09747fa1a..4c4dfa4497b 100644 --- a/sql/item_inetfunc.cc +++ b/sql/item_inetfunc.cc @@ -181,7 +181,8 @@ String *Item_func_inet_str_base::val_str_ascii(String *buffer) return NULL; } - String *arg_str= args[0]->val_str(buffer); + StringBuffer<STRING_BUFFER_USUAL_SIZE> tmp; + String *arg_str= args[0]->val_str(&tmp); if (!arg_str) // Out-of memory happened. The error has been reported. { // Or: the underlying field is NULL null_value= true; @@ -679,7 +680,7 @@ static void ipv6_to_str(const in6_addr *ipv6, char *str) @retval true The string has been converted sucessfully. */ -bool Item_func_inet6_aton::calc_value(String *arg, String *buffer) +bool Item_func_inet6_aton::calc_value(const String *arg, String *buffer) { // ipv4-string -> varbinary(4) // ipv6-string -> varbinary(16) @@ -719,7 +720,7 @@ bool Item_func_inet6_aton::calc_value(String *arg, String *buffer) @retval true The string has been converted sucessfully. */ -bool Item_func_inet6_ntoa::calc_value(String *arg, String *buffer) +bool Item_func_inet6_ntoa::calc_value(const String *arg, String *buffer) { if (arg->charset() != &my_charset_bin) return false; |