diff options
author | Monty <monty@mariadb.org> | 2020-08-19 02:53:22 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-05-19 22:27:53 +0200 |
commit | 30f0a246a0a2051a5228ecc1c365129ff9920396 (patch) | |
tree | b8cf06048af27a6383ac5f70b860d68156fac5a9 /plugin | |
parent | 53b43f30781fb26bf8a9764e4d852ac581edd964 (diff) | |
download | mariadb-git-30f0a246a0a2051a5228ecc1c365129ff9920396.tar.gz |
Added override to all releveant methods in Item (and a few other classes)
Other things:
- Remove inline and virtual for methods that are overrides
- Added a 'final' to some Item classes
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/func_test/plugin.cc | 9 | ||||
-rw-r--r-- | plugin/type_inet/item_inetfunc.h | 42 |
2 files changed, 26 insertions, 25 deletions
diff --git a/plugin/func_test/plugin.cc b/plugin/func_test/plugin.cc index b49f87832d6..f59ee82388c 100644 --- a/plugin/func_test/plugin.cc +++ b/plugin/func_test/plugin.cc @@ -24,12 +24,12 @@ class Item_func_sysconst_test :public Item_func_sysconst { public: Item_func_sysconst_test(THD *thd): Item_func_sysconst(thd) {} - String *val_str(String *str) + String *val_str(String *str) override { null_value= str->copy(STRING_WITH_LEN("sysconst_test"), system_charset_info); return null_value ? NULL : str; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen; set_maybe_null(); @@ -40,8 +40,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("sysconst_test") }; return name; } - const char *fully_qualified_func_name() const { return "sysconst_test()"; } - Item *get_copy(THD *thd) + const char *fully_qualified_func_name() const override + { return "sysconst_test()"; } + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_sysconst_test>(thd, this); } }; diff --git a/plugin/type_inet/item_inetfunc.h b/plugin/type_inet/item_inetfunc.h index 5568bf55bdf..4acb42d2175 100644 --- a/plugin/type_inet/item_inetfunc.h +++ b/plugin/type_inet/item_inetfunc.h @@ -27,17 +27,17 @@ class Item_func_inet_aton : public Item_longlong_func { - bool check_arguments() const + bool check_arguments() const override { return check_argument_types_can_return_text(0, arg_count); } public: Item_func_inet_aton(THD *thd, Item *a): Item_longlong_func(thd, a) {} - longlong val_int(); + longlong val_int() override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("inet_aton") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= 0; max_length= 21; @@ -45,7 +45,7 @@ public: unsigned_flag= 1; return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_inet_aton>(thd, this); } }; @@ -59,20 +59,20 @@ class Item_func_inet_ntoa : public Item_str_func public: Item_func_inet_ntoa(THD *thd, Item *a): Item_str_func(thd, a) { } - String* val_str(String* str); + String *val_str(String* str) override; LEX_CSTRING func_name_cstring() const override { static LEX_CSTRING name= {STRING_WITH_LEN("inet_ntoa") }; return name; } - bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= 0; fix_length_and_charset(3 * 8 + 7, default_charset()); set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_inet_ntoa>(thd, this); } }; @@ -111,17 +111,17 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("inet6_aton") }; return name; } - virtual bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= 0; fix_length_and_charset(16, &my_charset_bin); set_maybe_null(); return FALSE; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_inet6_aton>(thd, this); } - String *val_str(String *to); + String *val_str(String *to) override; }; @@ -143,7 +143,7 @@ public: return name; } - virtual bool fix_length_and_dec() + bool fix_length_and_dec() override { decimals= 0; @@ -155,8 +155,8 @@ public: set_maybe_null();; return FALSE; } - String *val_str_ascii(String *to); - Item *get_copy(THD *thd) + String *val_str_ascii(String *to) override; + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_inet6_ntoa>(thd, this); } }; @@ -178,10 +178,10 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_is_ipv4>(thd, this); } - longlong val_int(); + longlong val_int() override; }; @@ -201,10 +201,10 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv6") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_is_ipv6>(thd, this); } - longlong val_int(); + longlong val_int() override; }; @@ -223,9 +223,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_compat") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_is_ipv4_compat>(thd, this); } - longlong val_int(); + longlong val_int() override; }; @@ -244,9 +244,9 @@ public: static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_mapped") }; return name; } - Item *get_copy(THD *thd) + Item *get_copy(THD *thd) override { return get_item_copy<Item_func_is_ipv4_mapped>(thd, this); } - longlong val_int(); + longlong val_int() override; }; #endif // ITEM_INETFUNC_INCLUDED |