diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-12-13 15:09:03 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-12-13 15:09:03 +0400 |
commit | 4752a039b5fd8858e4562cff50cb486dea355a69 (patch) | |
tree | 30048ee361aab2d63b5d61f4fc0d822c59992fa2 /sql/item_inetfunc.h | |
parent | 5c0730e0ced93743dc9a80166125a175251ca871 (diff) | |
download | mariadb-git-4752a039b5fd8858e4562cff50cb486dea355a69.tar.gz |
MDEV-17995 INET6_NTOA(ucs2_input) erroneously returns NULL
Diffstat (limited to 'sql/item_inetfunc.h')
-rw-r--r-- | sql/item_inetfunc.h | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/sql/item_inetfunc.h b/sql/item_inetfunc.h index 024ff8ce4f0..4159d3db8e3 100644 --- a/sql/item_inetfunc.h +++ b/sql/item_inetfunc.h @@ -92,34 +92,14 @@ protected: /************************************************************************* - Item_func_inet_str_base implements common code for INET6/IP-related - functions returning string value. -*************************************************************************/ - -class Item_func_inet_str_base : public Item_str_ascii_func -{ -public: - inline Item_func_inet_str_base(THD *thd, Item *arg): - Item_str_ascii_func(thd, arg) - { } - -public: - virtual String *val_str_ascii(String *buffer); - -protected: - virtual bool calc_value(const String *arg, String *buffer) = 0; -}; - - -/************************************************************************* Item_func_inet6_aton implements INET6_ATON() SQL-function. *************************************************************************/ -class Item_func_inet6_aton : public Item_func_inet_str_base +class Item_func_inet6_aton : public Item_str_func { public: inline Item_func_inet6_aton(THD *thd, Item *ip_addr): - Item_func_inet_str_base(thd, ip_addr) + Item_str_func(thd, ip_addr) { } public: @@ -136,8 +116,10 @@ public: Item *get_copy(THD *thd) { return get_item_copy<Item_func_inet6_aton>(thd, this); } + String *val_str(String *to); + protected: - virtual bool calc_value(const String *arg, String *buffer); + bool calc_value(const String *arg, String *buffer); }; @@ -145,11 +127,11 @@ protected: Item_func_inet6_ntoa implements INET6_NTOA() SQL-function. *************************************************************************/ -class Item_func_inet6_ntoa : public Item_func_inet_str_base +class Item_func_inet6_ntoa : public Item_str_ascii_func { public: inline Item_func_inet6_ntoa(THD *thd, Item *ip_addr): - Item_func_inet_str_base(thd, ip_addr) + Item_str_ascii_func(thd, ip_addr) { } public: @@ -168,11 +150,12 @@ public: maybe_null= 1; return FALSE; } + String *val_str_ascii(String *to); Item *get_copy(THD *thd) { return get_item_copy<Item_func_inet6_ntoa>(thd, this); } protected: - virtual bool calc_value(const String *arg, String *buffer); + bool calc_value(const Binary_string *arg, String *buffer); }; |