Skip to content

Commit 30f0a24

Browse files
montywivuvova
authored andcommitted
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
1 parent 53b43f3 commit 30f0a24

23 files changed

+2495
-2389
lines changed

plugin/func_test/plugin.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ class Item_func_sysconst_test :public Item_func_sysconst
2424
{
2525
public:
2626
Item_func_sysconst_test(THD *thd): Item_func_sysconst(thd) {}
27-
String *val_str(String *str)
27+
String *val_str(String *str) override
2828
{
2929
null_value= str->copy(STRING_WITH_LEN("sysconst_test"), system_charset_info);
3030
return null_value ? NULL : str;
3131
}
32-
bool fix_length_and_dec()
32+
bool fix_length_and_dec() override
3333
{
3434
max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen;
3535
set_maybe_null();
@@ -40,8 +40,9 @@ class Item_func_sysconst_test :public Item_func_sysconst
4040
static LEX_CSTRING name= {STRING_WITH_LEN("sysconst_test") };
4141
return name;
4242
}
43-
const char *fully_qualified_func_name() const { return "sysconst_test()"; }
44-
Item *get_copy(THD *thd)
43+
const char *fully_qualified_func_name() const override
44+
{ return "sysconst_test()"; }
45+
Item *get_copy(THD *thd) override
4546
{ return get_item_copy<Item_func_sysconst_test>(thd, this); }
4647
};
4748

plugin/type_inet/item_inetfunc.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@
2727

2828
class Item_func_inet_aton : public Item_longlong_func
2929
{
30-
bool check_arguments() const
30+
bool check_arguments() const override
3131
{ return check_argument_types_can_return_text(0, arg_count); }
3232
public:
3333
Item_func_inet_aton(THD *thd, Item *a): Item_longlong_func(thd, a) {}
34-
longlong val_int();
34+
longlong val_int() override;
3535
LEX_CSTRING func_name_cstring() const override
3636
{
3737
static LEX_CSTRING name= {STRING_WITH_LEN("inet_aton") };
3838
return name;
3939
}
40-
bool fix_length_and_dec()
40+
bool fix_length_and_dec() override
4141
{
4242
decimals= 0;
4343
max_length= 21;
4444
set_maybe_null();
4545
unsigned_flag= 1;
4646
return FALSE;
4747
}
48-
Item *get_copy(THD *thd)
48+
Item *get_copy(THD *thd) override
4949
{ return get_item_copy<Item_func_inet_aton>(thd, this); }
5050
};
5151

@@ -59,20 +59,20 @@ class Item_func_inet_ntoa : public Item_str_func
5959
public:
6060
Item_func_inet_ntoa(THD *thd, Item *a): Item_str_func(thd, a)
6161
{ }
62-
String* val_str(String* str);
62+
String *val_str(String* str) override;
6363
LEX_CSTRING func_name_cstring() const override
6464
{
6565
static LEX_CSTRING name= {STRING_WITH_LEN("inet_ntoa") };
6666
return name;
6767
}
68-
bool fix_length_and_dec()
68+
bool fix_length_and_dec() override
6969
{
7070
decimals= 0;
7171
fix_length_and_charset(3 * 8 + 7, default_charset());
7272
set_maybe_null();
7373
return FALSE;
7474
}
75-
Item *get_copy(THD *thd)
75+
Item *get_copy(THD *thd) override
7676
{ return get_item_copy<Item_func_inet_ntoa>(thd, this); }
7777
};
7878

@@ -111,17 +111,17 @@ class Item_func_inet6_aton : public Item_str_func
111111
static LEX_CSTRING name= {STRING_WITH_LEN("inet6_aton") };
112112
return name;
113113
}
114-
virtual bool fix_length_and_dec()
114+
bool fix_length_and_dec() override
115115
{
116116
decimals= 0;
117117
fix_length_and_charset(16, &my_charset_bin);
118118
set_maybe_null();
119119
return FALSE;
120120
}
121-
Item *get_copy(THD *thd)
121+
Item *get_copy(THD *thd) override
122122
{ return get_item_copy<Item_func_inet6_aton>(thd, this); }
123123

124-
String *val_str(String *to);
124+
String *val_str(String *to) override;
125125
};
126126

127127

@@ -143,7 +143,7 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
143143
return name;
144144
}
145145

146-
virtual bool fix_length_and_dec()
146+
bool fix_length_and_dec() override
147147
{
148148
decimals= 0;
149149

@@ -155,8 +155,8 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
155155
set_maybe_null();;
156156
return FALSE;
157157
}
158-
String *val_str_ascii(String *to);
159-
Item *get_copy(THD *thd)
158+
String *val_str_ascii(String *to) override;
159+
Item *get_copy(THD *thd) override
160160
{ return get_item_copy<Item_func_inet6_ntoa>(thd, this); }
161161
};
162162

@@ -178,10 +178,10 @@ class Item_func_is_ipv4 : public Item_func_inet_bool_base
178178
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4") };
179179
return name;
180180
}
181-
Item *get_copy(THD *thd)
181+
Item *get_copy(THD *thd) override
182182
{ return get_item_copy<Item_func_is_ipv4>(thd, this); }
183183

184-
longlong val_int();
184+
longlong val_int() override;
185185
};
186186

187187

@@ -201,10 +201,10 @@ class Item_func_is_ipv6 : public Item_func_inet_bool_base
201201
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv6") };
202202
return name;
203203
}
204-
Item *get_copy(THD *thd)
204+
Item *get_copy(THD *thd) override
205205
{ return get_item_copy<Item_func_is_ipv6>(thd, this); }
206206

207-
longlong val_int();
207+
longlong val_int() override;
208208
};
209209

210210

@@ -223,9 +223,9 @@ class Item_func_is_ipv4_compat : public Item_func_inet_bool_base
223223
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_compat") };
224224
return name;
225225
}
226-
Item *get_copy(THD *thd)
226+
Item *get_copy(THD *thd) override
227227
{ return get_item_copy<Item_func_is_ipv4_compat>(thd, this); }
228-
longlong val_int();
228+
longlong val_int() override;
229229
};
230230

231231

@@ -244,9 +244,9 @@ class Item_func_is_ipv4_mapped : public Item_func_inet_bool_base
244244
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_mapped") };
245245
return name;
246246
}
247-
Item *get_copy(THD *thd)
247+
Item *get_copy(THD *thd) override
248248
{ return get_item_copy<Item_func_is_ipv4_mapped>(thd, this); }
249-
longlong val_int();
249+
longlong val_int() override;
250250
};
251251

252252
#endif // ITEM_INETFUNC_INCLUDED

sql/field.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,7 +1198,7 @@ class Field: public Value_source
11981198
virtual uint16 key_part_flag() const { return 0; }
11991199
virtual uint16 key_part_length_bytes() const { return 0; }
12001200
virtual uint32 key_length() const { return pack_length(); }
1201-
virtual const Type_handler *type_handler() const= 0;
1201+
virtual const Type_handler *type_handler() const = 0;
12021202
virtual enum_field_types type() const
12031203
{
12041204
return type_handler()->field_type();
@@ -4155,7 +4155,7 @@ class Field_varstring :public Field_longstr {
41554155
{
41564156
return (uint32) field_length + sort_suffix_length();
41574157
}
4158-
virtual uint32 sort_suffix_length() const override
4158+
uint32 sort_suffix_length() const override
41594159
{
41604160
return (field_charset() == &my_charset_bin ? length_bytes : 0);
41614161
}
@@ -4505,7 +4505,7 @@ class Field_blob :public Field_longstr {
45054505
uint32 sort_length() const override;
45064506
uint32 sort_suffix_length() const override;
45074507
uint32 value_length() override { return get_length(); }
4508-
virtual uint32 max_data_length() const override
4508+
uint32 max_data_length() const override
45094509
{
45104510
return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
45114511
}

sql/ha_partition.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ class ha_partition :public handler
467467
}
468468
Partition_share *get_part_share() { return part_share; }
469469
handler *clone(const char *name, MEM_ROOT *mem_root) override;
470-
virtual void set_part_info(partition_info *part_info) override
470+
void set_part_info(partition_info *part_info) override
471471
{
472472
m_part_info= part_info;
473473
m_is_sub_partitioned= part_info->is_sub_partitioned();

0 commit comments

Comments
 (0)