summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-08-19 02:53:22 +0300
committerSergei Golubchik <serg@mariadb.org>2021-05-19 22:27:53 +0200
commit30f0a246a0a2051a5228ecc1c365129ff9920396 (patch)
treeb8cf06048af27a6383ac5f70b860d68156fac5a9
parent53b43f30781fb26bf8a9764e4d852ac581edd964 (diff)
downloadmariadb-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
-rw-r--r--plugin/func_test/plugin.cc9
-rw-r--r--plugin/type_inet/item_inetfunc.h42
-rw-r--r--sql/field.h6
-rw-r--r--sql/ha_partition.h2
-rw-r--r--sql/item.h110
-rw-r--r--sql/item_cmpfunc.h830
-rw-r--r--sql/item_func.h1145
-rw-r--r--sql/item_geofunc.h250
-rw-r--r--sql/item_jsonfunc.h201
-rw-r--r--sql/item_row.h72
-rw-r--r--sql/item_strfunc.h615
-rw-r--r--sql/item_subselect.h51
-rw-r--r--sql/item_sum.h481
-rw-r--r--sql/item_timefunc.h577
-rw-r--r--sql/item_vers.h31
-rw-r--r--sql/item_windowfunc.h262
-rw-r--r--sql/item_xmlfunc.cc93
-rw-r--r--sql/item_xmlfunc.h14
-rw-r--r--sql/procedure.h63
-rw-r--r--sql/sp_pcontext.h3
-rw-r--r--sql/sql_class.h3
-rw-r--r--sql/sql_select.h20
-rw-r--r--storage/maria/ha_s3.h4
23 files changed, 2495 insertions, 2389 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
diff --git a/sql/field.h b/sql/field.h
index 499bf5e3c1f..08a334e5a6f 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -1198,7 +1198,7 @@ public:
virtual uint16 key_part_flag() const { return 0; }
virtual uint16 key_part_length_bytes() const { return 0; }
virtual uint32 key_length() const { return pack_length(); }
- virtual const Type_handler *type_handler() const= 0;
+ virtual const Type_handler *type_handler() const = 0;
virtual enum_field_types type() const
{
return type_handler()->field_type();
@@ -4155,7 +4155,7 @@ public:
{
return (uint32) field_length + sort_suffix_length();
}
- virtual uint32 sort_suffix_length() const override
+ uint32 sort_suffix_length() const override
{
return (field_charset() == &my_charset_bin ? length_bytes : 0);
}
@@ -4505,7 +4505,7 @@ public:
uint32 sort_length() const override;
uint32 sort_suffix_length() const override;
uint32 value_length() override { return get_length(); }
- virtual uint32 max_data_length() const override
+ uint32 max_data_length() const override
{
return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
}
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index fcd44beb74e..df204cd3d2d 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -467,7 +467,7 @@ public:
}
Partition_share *get_part_share() { return part_share; }
handler *clone(const char *name, MEM_ROOT *mem_root) override;
- virtual void set_part_info(partition_info *part_info) override
+ void set_part_info(partition_info *part_info) override
{
m_part_info= part_info;
m_is_sub_partitioned= part_info->is_sub_partitioned();
diff --git a/sql/item.h b/sql/item.h
index 62a3204a257..f3f2364ba5f 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -2061,7 +2061,7 @@ public:
The process of compilation is assumed to go as follows:
compile()
- {
+ {
if (this->*some_analyzer(...))
{
compile children if any;
@@ -2213,7 +2213,7 @@ public:
assumes that there are no multi-byte collations amongst the partition
fields.
*/
- virtual bool check_partition_func_processor(void *arg) { return 1;}
+ virtual bool check_partition_func_processor(void *arg) { return true; }
virtual bool post_fix_fields_part_expr_processor(void *arg) { return 0; }
virtual bool rename_fields_processor(void *arg) { return 0; }
/*
@@ -2599,7 +2599,7 @@ public:
int get_extraction_flag()
{ return marker & EXTRACTION_MASK; }
void set_extraction_flag(int16 flags)
- {
+ {
marker &= ~EXTRACTION_MASK;
marker|= flags;
}
@@ -2988,7 +2988,6 @@ public:
public:
bool fix_fields(THD *thd, Item **) override= 0;
-
double val_real() override;
longlong val_int() override;
String *val_str(String *sp) override;
@@ -2999,9 +2998,7 @@ public:
public:
void make_send_field(THD *thd, Send_field *field) override;
-
bool const_item() const override { return true; }
-
Field *create_tmp_field_ex(MEM_ROOT *root,
TABLE *table, Tmp_field_src *src,
const Tmp_field_param *param) override
@@ -3303,7 +3300,7 @@ public:
}
int save_in_field(Field *field, bool no_conversions) override
{
- return value_item->save_in_field(field, no_conversions);
+ return value_item->save_in_field(field, no_conversions);
}
bool send(Protocol *protocol, st_value *buffer) override
@@ -3849,7 +3846,7 @@ public:
{
save_in_field(result_field, no_conversions);
}
- bool check_partition_func_processor(void *) override { return true; }
+ bool check_partition_func_processor(void *int_arg) override { return true; }
bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(full_name(), arg, VCOL_IMPOSSIBLE);
@@ -4263,23 +4260,18 @@ public:
bool append_for_log(THD *thd, String *str) override;
bool check_vcol_func_processor(void *) override { return false; }
Item *get_copy(THD *) override { return nullptr; }
-
bool add_as_clone(THD *thd);
void sync_clones();
bool register_clone(Item_param *i) { return m_clones.push_back(i); }
private:
void invalid_default_param() const;
-
bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;
-
void set_out_param_info(Send_field *info) override;
public:
const Send_field *get_out_param_info() const override;
-
Item_param *get_item_param() override { return this; }
-
void make_send_field(THD *thd, Send_field *field) override;
private:
@@ -4397,12 +4389,12 @@ public:
Item_uint(THD *thd, const char *str_arg, size_t length);
Item_uint(THD *thd, ulonglong i): Item_int(thd, i, 10) {}
Item_uint(THD *thd, const char *str_arg, longlong i, uint length);
- double val_real() { return ulonglong2double((ulonglong)value); }
- Item *clone_item(THD *thd);
- Item *neg(THD *thd);
+ double val_real() override { return ulonglong2double((ulonglong)value); }
+ Item *clone_item(THD *thd) override;
+ Item *neg(THD *thd) override;
decimal_digits_t decimal_precision() const override
{ return decimal_digits_t(max_length); }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_uint>(thd, this); }
};
@@ -4444,9 +4436,12 @@ public:
{ return &type_handler_newdecimal; }
longlong val_int() override
{ return decimal_value.to_longlong(unsigned_flag); }
- double val_real() override { return decimal_value.to_double(); }
- String *val_str(String *to) override { return decimal_value.to_string(to); }
- my_decimal *val_decimal(my_decimal *val) override { return &decimal_value; }
+ double val_real() override
+ { return decimal_value.to_double(); }
+ String *val_str(String *to) override
+ { return decimal_value.to_string(to); }
+ my_decimal *val_decimal(my_decimal *val) override
+ { return &decimal_value; }
const my_decimal *const_ptr_my_decimal() const override
{ return &decimal_value; }
int save_in_field(Field *field, bool no_conversions) override;
@@ -4519,12 +4514,10 @@ public:
uint decimal_par, uint length):
Item_float(thd, NullS, val_arg, decimal_par, length), func_name(str)
{}
-
void print(String *str, enum_query_type) override
{
str->append(func_name, strlen(func_name));
}
-
Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
{
return const_charset_converter(thd, tocs, true, func_name);
@@ -4665,8 +4658,7 @@ public:
{ return Item::check_well_formed_result(&str_value, send_error); }
Item_basic_constant *make_string_literal_concat(THD *thd,
- const LEX_CSTRING *)
- override;
+ const LEX_CSTRING *) override;
Item *make_odbc_literal(THD *thd, const LEX_CSTRING *typestr) override;
Item *get_copy(THD *thd) override
@@ -4804,7 +4796,7 @@ public:
{
unsigned_flag=1;
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
const Type_handler *h=
Type_handler::get_handler_by_field_type(int_field_type);
@@ -4830,14 +4822,15 @@ public:
{
hex_string_init(thd, str, str_length);
}
- const Type_handler *type_handler() const { return &type_handler_varchar; }
- virtual Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs)
+ const Type_handler *type_handler() const override
+ { return &type_handler_varchar; }
+ Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
{
return const_charset_converter(thd, tocs, true);
}
- const String *const_ptr_string() const { return &str_value; }
- String *val_str(String*) { return &str_value; }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ const String *const_ptr_string() const override { return &str_value; }
+ String *val_str(String*) override { return &str_value; }
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
@@ -4859,7 +4852,7 @@ public:
{ return &type_handler_hex_hybrid; }
decimal_digits_t decimal_precision() const override;
double val_real() override
- {
+ {
return (double) (ulonglong) Item_hex_hybrid::val_int();
}
longlong val_int() override
@@ -5071,7 +5064,7 @@ public:
/**
TIME'10:10:10'
*/
-class Item_time_literal: public Item_temporal_literal
+class Item_time_literal final: public Item_temporal_literal
{
protected:
Time cached_time;
@@ -5114,6 +5107,7 @@ public:
/**
TIMESTAMP'2001-01-01 10:20:30'
*/
+
class Item_datetime_literal: public Item_temporal_literal
{
protected:
@@ -5180,7 +5174,7 @@ class Item_date_literal_for_invalid_dates: public Item_date_literal
WHERE date_column='2001-01-01' ... ->
WHERE date_column=DATE'2001-01-01' ...
- This is done to make the eqial field propagation code handle mixtures of
+ This is done to make the equal field propagation code handle mixtures of
different temporal types in the same expressions easier (MDEV-8706), e.g.
WHERE LENGTH(date_column)=10 AND date_column=TIME'00:00:00'
@@ -5215,7 +5209,7 @@ public:
An error-safe counterpart for Item_datetime_literal
(see Item_date_literal_for_invalid_dates for comments)
*/
-class Item_datetime_literal_for_invalid_dates: public Item_datetime_literal
+class Item_datetime_literal_for_invalid_dates final: public Item_datetime_literal
{
public:
Item_datetime_literal_for_invalid_dates(THD *thd,
@@ -5501,7 +5495,7 @@ public:
enum Type type() const override { return REF_ITEM; }
enum Type real_type() const override
{ return ref ? (*ref)->type() : REF_ITEM; }
- bool eq(const Item *item, bool binary_cmp) const
+ bool eq(const Item *item, bool binary_cmp) const override
{
Item *it= ((Item *) item)->real_item();
return ref && (*ref)->eq(it, binary_cmp);
@@ -5563,7 +5557,10 @@ public:
return Item_ident::build_equal_items(thd, inherited, link_item_fields,
cond_equal_ref);
}
- bool const_item() const override { return (*ref)->const_item(); }
+ bool const_item() const override
+ {
+ return (*ref)->const_item();
+ }
table_map not_null_tables() const override
{
return depended_from ? 0 : (*ref)->not_null_tables();
@@ -5576,7 +5573,10 @@ public:
{
(*ref)->save_in_field(result_field, no_conversions);
}
- Item *real_item() override { return ref ? (*ref)->real_item() : this; }
+ Item *real_item() override
+ {
+ return ref ? (*ref)->real_item() : this;
+ }
const TYPELIB *get_typelib() const override
{
return ref ? (*ref)->get_typelib() : NULL;
@@ -5611,7 +5611,7 @@ public:
}
void cleanup() override;
Item_field *field_for_view_update() override
- { return (*ref)->field_for_view_update(); }
+ { return (*ref)->field_for_view_update(); }
Load_data_outvar *get_load_data_outvar() override
{
return (*ref)->get_load_data_outvar();
@@ -5821,13 +5821,10 @@ public:
Type type() const override { return EXPR_CACHE_ITEM; }
Type real_type() const override { return orig_item->type(); }
-
bool set_cache(THD *thd);
Expression_cache_tracker* init_tracker(MEM_ROOT *mem_root);
-
bool fix_fields(THD *thd, Item **it) override;
void cleanup() override;
-
Item *get_orig_item() const { return orig_item; }
/* Methods of getting value which should be cached in the cache */
@@ -5868,8 +5865,12 @@ public:
int save_in_field(Field *to, bool no_conversions) override;
const Type_handler *type_handler() const override
{ return orig_item->type_handler(); }
- table_map used_tables() const override { return orig_item->used_tables(); }
- void update_used_tables() override { orig_item->update_used_tables(); }
+ table_map used_tables() const override
+ { return orig_item->used_tables(); }
+ void update_used_tables() override
+ {
+ orig_item->update_used_tables();
+ }
bool const_item() const override { return orig_item->const_item(); }
table_map not_null_tables() const override
{ return orig_item->not_null_tables(); }
@@ -5979,7 +5980,7 @@ public:
table_map used_tables() const override;
void update_used_tables() override;
table_map not_null_tables() const override;
- bool const_item() const override { return used_tables() == 0; }
+ bool const_item() const override{ return used_tables() == 0; }
TABLE *get_null_ref_table() const { return null_ref_table; }
bool walk(Item_processor processor, bool walk_subquery, void *arg) override
{
@@ -6344,7 +6345,6 @@ public:
Override the methods below as pure virtual to make sure all the
sub-classes implement them.
*/
-
String *val_str(String*) override = 0;
my_decimal *val_decimal(my_decimal *) override = 0;
double val_real() override = 0;
@@ -6610,13 +6610,11 @@ public:
Item_field *field_for_view_update() override { return nullptr; }
bool update_vcol_processor(void *) override { return false; }
bool check_func_default_processor(void *) override { return true; }
-
bool walk(Item_processor processor, bool walk_subquery, void *args) override
{
return (arg && arg->walk(processor, walk_subquery, args)) ||
(this->*processor)(args);
}
-
Item *transform(THD *thd, Item_transformer transformer, uchar *args)
override;
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
@@ -6970,7 +6968,7 @@ public:
virtual void keep_array() {}
void print(String *str, enum_query_type query_type) override;
bool eq_def(const Field *field)
- {
+ {
return cached_field ? cached_field->eq_def (field) : FALSE;
}
bool eq(const Item *item, bool binary_cmp) const override
@@ -6981,7 +6979,8 @@ public:
{
if (example)
{
- Item::vcol_func_processor_result *res= (Item::vcol_func_processor_result*)arg;
+ Item::vcol_func_processor_result *res=
+ (Item::vcol_func_processor_result*) arg;
example->check_vcol_func_processor(arg);
/*
Item_cache of a non-deterministic function requires re-fixing
@@ -7293,8 +7292,8 @@ public:
Item_cache_double(THD *thd)
:Item_cache_real(thd, &type_handler_double)
{ }
- String* val_str(String *str);
- Item *get_copy(THD *thd)
+ String *val_str(String *str) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_cache_double>(thd, this); }
};
@@ -7305,8 +7304,8 @@ public:
Item_cache_float(THD *thd)
:Item_cache_real(thd, &type_handler_float)
{ }
- String* val_str(String *str);
- Item *get_copy(THD *thd)
+ String *val_str(String *str) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_cache_float>(thd, this); }
};
@@ -7370,7 +7369,7 @@ public:
Item_cache_str_for_nullif(THD *thd, const Item *item)
:Item_cache_str(thd, item)
{ }
- Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs)
+ Item *safe_charset_converter(THD *thd, CHARSET_INFO *tocs) override
{
/**
Item_cache_str::safe_charset_converter() returns a new Item_cache
@@ -7384,7 +7383,7 @@ public:
*/
return Item::safe_charset_converter(thd, tocs);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_cache_str_for_nullif>(thd, this); }
};
@@ -7537,7 +7536,6 @@ public:
*this, table);
}
Item* get_copy(THD *) override { return nullptr; }
-
};
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 5005089577a..87489106a9a 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -222,12 +222,14 @@ public:
Item_bool_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {}
Item_bool_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {}
- const Type_handler *type_handler() const { return &type_handler_bool; }
- const Type_handler *fixed_type_handler() const { return &type_handler_bool; }
- CHARSET_INFO *compare_collation() const { return NULL; }
- bool fix_length_and_dec() { decimals=0; max_length=1; return FALSE; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_bool; }
+ const Type_handler *fixed_type_handler() const override
+ { return &type_handler_bool; }
+ CHARSET_INFO *compare_collation() const override { return NULL; }
+ bool fix_length_and_dec() override { decimals=0; max_length=1; return FALSE; }
decimal_digits_t decimal_precision() const override { return 1; }
- bool need_parentheses_in_default() { return true; }
+ bool need_parentheses_in_default() override { return true; }
};
@@ -239,11 +241,11 @@ public:
class Item_func_truth : public Item_bool_func
{
public:
- virtual bool val_bool();
- virtual longlong val_int();
- virtual bool fix_length_and_dec();
- virtual void print(String *str, enum_query_type query_type);
- enum precedence precedence() const { return CMP_PRECEDENCE; }
+ bool val_bool() override;
+ longlong val_int() override;
+ bool fix_length_and_dec() override;
+ void print(String *str, enum_query_type query_type) override;
+ enum precedence precedence() const override { return CMP_PRECEDENCE; }
protected:
Item_func_truth(THD *thd, Item *a, bool a_value, bool a_affirmative):
@@ -279,7 +281,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("istrue") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_istrue>(thd, this); }
};
@@ -299,10 +301,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("isnottrue") };
return name;
}
- bool find_not_null_fields(table_map allowed) { return false; }
- Item *get_copy(THD *thd)
+ bool find_not_null_fields(table_map allowed) override { return false; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isnottrue>(thd, this); }
- bool eval_not_null_tables(void *) { not_null_tables_cache= 0; return false; }
+ bool eval_not_null_tables(void *) override
+ { not_null_tables_cache= 0; return false; }
};
@@ -320,7 +323,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("isfalse") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isfalse>(thd, this); }
};
@@ -340,10 +343,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("isnotfalse") };
return name;
}
- bool find_not_null_fields(table_map allowed) { return false; }
- Item *get_copy(THD *thd)
+ bool find_not_null_fields(table_map allowed) override { return false; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isnotfalse>(thd, this); }
- bool eval_not_null_tables(void *) { not_null_tables_cache= 0; return false; }
+ bool eval_not_null_tables(void *) override
+ { not_null_tables_cache= 0; return false; }
};
@@ -533,7 +537,7 @@ class Item_bool_rowready_func2 :public Item_bool_func2_with_rev
{
protected:
Arg_comparator cmp;
- bool check_arguments() const
+ bool check_arguments() const override
{
return check_argument_types_like_args0();
}
@@ -541,15 +545,16 @@ public:
Item_bool_rowready_func2(THD *thd, Item *a, Item *b):
Item_bool_func2_with_rev(thd, a, b), cmp(tmp_arg, tmp_arg + 1)
{ }
- Sql_mode_dependency value_depends_on_sql_mode() const;
- void print(String *str, enum_query_type query_type)
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ void print(String *str, enum_query_type query_type) override
{
Item_func::print_op(str, query_type);
}
- enum precedence precedence() const { return CMP_PRECEDENCE; }
- Item *neg_transformer(THD *thd);
+ enum precedence precedence() const override { return CMP_PRECEDENCE; }
+ Item *neg_transformer(THD *thd) override;
virtual Item *negated_item(THD *thd);
- Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
Item_args::propagate_equal_fields(thd,
Context(ANY_SUBST,
@@ -558,30 +563,31 @@ public:
cond);
return this;
}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
int set_cmp_func(THD *thd)
{
return cmp.set_cmp_func(thd, this, tmp_arg, tmp_arg + 1, true);
}
- CHARSET_INFO *compare_collation() const { return cmp.compare_collation(); }
- const Type_handler *compare_type_handler() const
+ CHARSET_INFO *compare_collation() const override
+ { return cmp.compare_collation(); }
+ const Type_handler *compare_type_handler() const override
{
return cmp.compare_type_handler();
}
Arg_comparator *get_comparator() { return &cmp; }
- void cleanup()
+ void cleanup() override
{
Item_bool_func2::cleanup();
cmp.cleanup();
}
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables)
+ SARGABLE_PARAM **sargables) override
{
return add_key_fields_optimize_op(join, key_fields, and_level,
usable_tables, sargables, false);
}
- Item *build_clone(THD *thd)
+ Item *build_clone(THD *thd) override
{
Item_bool_rowready_func2 *clone=
(Item_bool_rowready_func2 *) Item_func::build_clone(thd);
@@ -602,24 +608,24 @@ class Item_func_xor :public Item_bool_func
{
public:
Item_func_xor(THD *thd, Item *i1, Item *i2): Item_bool_func(thd, i1, i2) {}
- enum Functype functype() const { return XOR_FUNC; }
+ enum Functype functype() const override { return XOR_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("xor") };
return name;
}
- enum precedence precedence() const { return XOR_PRECEDENCE; }
- void print(String *str, enum_query_type query_type)
+ enum precedence precedence() const override { return XOR_PRECEDENCE; }
+ void print(String *str, enum_query_type query_type) override
{ Item_func::print_op(str, query_type); }
- longlong val_int();
- bool find_not_null_fields(table_map allowed) { return false; }
- Item *neg_transformer(THD *thd);
- Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ longlong val_int() override;
+ bool find_not_null_fields(table_map allowed) override { return false; }
+ Item *neg_transformer(THD *thd) override;
+ Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond) override
{
Item_args::propagate_equal_fields(thd, Context_boolean(), cond);
return this;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xor>(thd, this); }
};
@@ -684,19 +690,19 @@ class Item_func_trig_cond: public Item_bool_func
public:
Item_func_trig_cond(THD *thd, Item *a, bool *f): Item_bool_func(thd, a)
{ trig_var= f; }
- longlong val_int() { return *trig_var ? args[0]->val_int() : 1; }
- enum Functype functype() const { return TRIG_COND_FUNC; };
+ longlong val_int() override { return *trig_var ? args[0]->val_int() : 1; }
+ enum Functype functype() const override { return TRIG_COND_FUNC; };
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("trigcond") };
return name;
}
- bool const_item() const { return FALSE; }
+ bool const_item() const override { return FALSE; }
bool *get_trig_var() { return trig_var; }
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables);
- Item *get_copy(THD *thd)
+ SARGABLE_PARAM **sargables) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trig_cond>(thd, this); }
};
@@ -712,21 +718,21 @@ public:
Item_func_not_all(THD *thd, Item *a):
Item_func_not(thd, a), test_sum_item(0), test_sub_item(0), show(0)
{}
- table_map not_null_tables() const { return 0; }
- longlong val_int();
- enum Functype functype() const { return NOT_ALL_FUNC; }
+ table_map not_null_tables() const override { return 0; }
+ longlong val_int() override;
+ enum Functype functype() const override { return NOT_ALL_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<not>") };
return name;
}
- bool fix_fields(THD *thd, Item **ref)
- {return Item_func::fix_fields(thd, ref);}
- virtual void print(String *str, enum_query_type query_type);
+ bool fix_fields(THD *thd, Item **ref) override
+ { return Item_func::fix_fields(thd, ref);}
+ void print(String *str, enum_query_type query_type) override;
void set_sum_test(Item_sum_min_max *item) { test_sum_item= item; test_sub_item= 0; };
void set_sub_test(Item_maxmin_subselect *item) { test_sub_item= item; test_sum_item= 0;};
bool empty_underlying_subquery();
- Item *neg_transformer(THD *thd);
+ Item *neg_transformer(THD *thd) override;
};
@@ -735,14 +741,14 @@ class Item_func_nop_all :public Item_func_not_all
public:
Item_func_nop_all(THD *thd, Item *a): Item_func_not_all(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<nop>") };
return name;
}
- Item *neg_transformer(THD *thd);
- Item *get_copy(THD *thd)
+ Item *neg_transformer(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_nop_all>(thd, this); }
};
@@ -755,28 +761,28 @@ public:
Item_bool_rowready_func2(thd, a, b),
abort_on_null(false), in_equality_no(UINT_MAX)
{}
- longlong val_int();
- enum Functype functype() const { return EQ_FUNC; }
- enum Functype rev_functype() const { return EQ_FUNC; }
- cond_result eq_cmp_result() const { return COND_TRUE; }
+ longlong val_int() override;
+ enum Functype functype() const override { return EQ_FUNC; }
+ enum Functype rev_functype() const override { return EQ_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_TRUE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("=") };
return name;
}
- void top_level_item() { abort_on_null= true; }
- Item *negated_item(THD *thd);
+ void top_level_item() override { abort_on_null= true; }
+ Item *negated_item(THD *thd) override;
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
- COND_EQUAL **cond_equal_ref);
+ COND_EQUAL **cond_equal_ref) override;
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables)
+ SARGABLE_PARAM **sargables) override
{
return add_key_fields_optimize_op(join, key_fields, and_level,
usable_tables, sargables, true);
}
- bool check_equality(THD *thd, COND_EQUAL *cond, List<Item> *eq_list);
+ bool check_equality(THD *thd, COND_EQUAL *cond, List<Item> *eq_list) override;
/*
- If this equality is created from the subquery's IN-equality:
number of the item it was created from, e.g. for
@@ -785,9 +791,9 @@ public:
- Otherwise, UINT_MAX
*/
uint in_equality_no;
- virtual uint exists2in_reserved_items() { return 1; };
+ uint exists2in_reserved_items() override { return 1; };
friend class Arg_comparator;
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_eq>(thd, this); }
};
@@ -796,27 +802,27 @@ class Item_func_equal final :public Item_bool_rowready_func2
public:
Item_func_equal(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b) {}
- longlong val_int();
- bool fix_length_and_dec();
- table_map not_null_tables() const { return 0; }
- bool find_not_null_fields(table_map allowed) { return false; }
- enum Functype functype() const { return EQUAL_FUNC; }
- enum Functype rev_functype() const { return EQUAL_FUNC; }
- cond_result eq_cmp_result() const { return COND_TRUE; }
+ longlong val_int() override;
+ bool fix_length_and_dec() override;
+ table_map not_null_tables() const override { return 0; }
+ bool find_not_null_fields(table_map allowed) override { return false; }
+ enum Functype functype() const override { return EQUAL_FUNC; }
+ enum Functype rev_functype() const override { return EQUAL_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_TRUE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<=>") };
return name;
}
- Item *neg_transformer(THD *thd) { return 0; }
+ Item *neg_transformer(THD *thd) override { return 0; }
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables)
+ SARGABLE_PARAM **sargables) override
{
return add_key_fields_optimize_op(join, key_fields, and_level,
usable_tables, sargables, true);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_equal>(thd, this); }
};
@@ -826,17 +832,17 @@ class Item_func_ge :public Item_bool_rowready_func2
public:
Item_func_ge(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b) {};
- longlong val_int();
- enum Functype functype() const { return GE_FUNC; }
- enum Functype rev_functype() const { return LE_FUNC; }
- cond_result eq_cmp_result() const { return COND_TRUE; }
+ longlong val_int() override;
+ enum Functype functype() const override { return GE_FUNC; }
+ enum Functype rev_functype() const override { return LE_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_TRUE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN(">=") };
return name;
}
- Item *negated_item(THD *thd);
- Item *get_copy(THD *thd)
+ Item *negated_item(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ge>(thd, this); }
};
@@ -846,17 +852,17 @@ class Item_func_gt :public Item_bool_rowready_func2
public:
Item_func_gt(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b) {};
- longlong val_int();
- enum Functype functype() const { return GT_FUNC; }
- enum Functype rev_functype() const { return LT_FUNC; }
- cond_result eq_cmp_result() const { return COND_FALSE; }
+ longlong val_int() override;
+ enum Functype functype() const override { return GT_FUNC; }
+ enum Functype rev_functype() const override { return LT_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_FALSE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN(">") };
return name;
}
- Item *negated_item(THD *thd);
- Item *get_copy(THD *thd)
+ Item *negated_item(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_gt>(thd, this); }
};
@@ -866,17 +872,17 @@ class Item_func_le :public Item_bool_rowready_func2
public:
Item_func_le(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b) {};
- longlong val_int();
- enum Functype functype() const { return LE_FUNC; }
- enum Functype rev_functype() const { return GE_FUNC; }
- cond_result eq_cmp_result() const { return COND_TRUE; }
+ longlong val_int() override;
+ enum Functype functype() const override { return LE_FUNC; }
+ enum Functype rev_functype() const override { return GE_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_TRUE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<=") };
return name;
}
- Item *negated_item(THD *thd);
- Item *get_copy(THD *thd)
+ Item *negated_item(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_le>(thd, this); }
};
@@ -886,17 +892,17 @@ class Item_func_lt :public Item_bool_rowready_func2
public:
Item_func_lt(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b) {}
- longlong val_int();
- enum Functype functype() const { return LT_FUNC; }
- enum Functype rev_functype() const { return GT_FUNC; }
- cond_result eq_cmp_result() const { return COND_FALSE; }
+ longlong val_int() override;
+ enum Functype functype() const override { return LT_FUNC; }
+ enum Functype rev_functype() const override { return GT_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_FALSE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<") };
return name;
}
- Item *negated_item(THD *thd);
- Item *get_copy(THD *thd)
+ Item *negated_item(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_lt>(thd, this); }
};
@@ -905,23 +911,23 @@ class Item_func_ne :public Item_bool_rowready_func2
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
- Field *field, Item *value);
+ Field *field, Item *value) override;
public:
Item_func_ne(THD *thd, Item *a, Item *b):
Item_bool_rowready_func2(thd, a, b) {}
- longlong val_int();
- enum Functype functype() const { return NE_FUNC; }
- enum Functype rev_functype() const { return NE_FUNC; }
- cond_result eq_cmp_result() const { return COND_FALSE; }
+ longlong val_int() override;
+ enum Functype functype() const override { return NE_FUNC; }
+ enum Functype rev_functype() const override { return NE_FUNC; }
+ cond_result eq_cmp_result() const override { return COND_FALSE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<>") };
return name;
}
- Item *negated_item(THD *thd);
+ Item *negated_item(THD *thd) override;
void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
- table_map usable_tables, SARGABLE_PARAM **sargables);
- Item *get_copy(THD *thd)
+ table_map usable_tables, SARGABLE_PARAM **sargables) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ne>(thd, this); }
};
@@ -977,41 +983,43 @@ class Item_func_between :public Item_func_opt_neg
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
- Field *field, Item *value);
+ Field *field, Item *value) override;
bool val_int_cmp_int_finalize(longlong value, longlong a, longlong b);
public:
String value0,value1,value2;
Item_func_between(THD *thd, Item *a, Item *b, Item *c):
Item_func_opt_neg(thd, a, b, c) { }
- longlong val_int()
+ longlong val_int() override
{
DBUG_ASSERT(fixed());
return m_comparator.type_handler()->Item_func_between_val_int(this);
}
- enum Functype functype() const { return BETWEEN; }
+ enum Functype functype() const override { return BETWEEN; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("between") };
return name;
}
- enum precedence precedence() const { return BETWEEN_PRECEDENCE; }
- bool fix_length_and_dec();
+ enum precedence precedence() const override { return BETWEEN_PRECEDENCE; }
+ bool fix_length_and_dec() override;
bool fix_length_and_dec_string(THD *)
{
return agg_arg_charsets_for_comparison(cmp_collation, args, 3);
}
bool fix_length_and_dec_temporal(THD *);
bool fix_length_and_dec_numeric(THD *);
- virtual void print(String *str, enum_query_type query_type);
- bool eval_not_null_tables(void *opt_arg);
- bool find_not_null_fields(table_map allowed);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
- bool count_sargable_conds(void *arg);
+ void print(String *str, enum_query_type query_type) override;
+ bool eval_not_null_tables(void *opt_arg) override;
+ bool find_not_null_fields(table_map allowed) override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
+ override;
+ bool count_sargable_conds(void *arg) override;
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
+ SARGABLE_PARAM **sargables) override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
Item_args::propagate_equal_fields(thd,
Context(ANY_SUBST,
@@ -1020,7 +1028,7 @@ public:
cond);
return this;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_between>(thd, this); }
longlong val_int_cmp_string();
@@ -1035,28 +1043,28 @@ public:
class Item_func_strcmp :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_str(0, 2); }
String value1, value2;
DTCollation cmp_collation;
public:
Item_func_strcmp(THD *thd, Item *a, Item *b):
Item_long_func(thd, a, b) {}
- longlong val_int();
+ longlong val_int() override;
decimal_digits_t decimal_precision() const override { return 1; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("strcmp") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
return TRUE;
fix_char_length(2); // returns "1" or "0" or "-1"
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_strcmp>(thd, this); }
};
@@ -1073,7 +1081,7 @@ class Item_func_interval :public Item_long_func
Item_row *row;
bool use_decimal_comparison;
interval_range *intervals;
- bool check_arguments() const
+ bool check_arguments() const override
{
return check_argument_types_like_args0();
}
@@ -1081,21 +1089,21 @@ public:
Item_func_interval(THD *thd, Item_row *a):
Item_long_func(thd, a), row(a), intervals(0)
{ }
- bool fix_fields(THD *, Item **);
- longlong val_int();
- bool fix_length_and_dec();
+ bool fix_fields(THD *, Item **) override;
+ longlong val_int() override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("interval") };
return name;
}
decimal_digits_t decimal_precision() const override { return 2; }
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
str->append(func_name_cstring());
print_args(str, 0, query_type);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_interval>(thd, this); }
};
@@ -1107,14 +1115,14 @@ public:
Item_func_case_expression(thd, a, b) {}
Item_func_coalesce(THD *thd, List<Item> &list):
Item_func_case_expression(thd, list) {}
- double real_op();
- longlong int_op();
- String *str_op(String *);
- my_decimal *decimal_op(my_decimal *);
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- bool native_op(THD *thd, Native *to);
- bool fix_length_and_dec()
+ double real_op() override;
+ longlong int_op() override;
+ String *str_op(String *) override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ bool native_op(THD *thd, Native *to) override;
+ bool fix_length_and_dec() override
{
if (aggregate_for_result(func_name_cstring(), args, arg_count, true))
return TRUE;
@@ -1126,8 +1134,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("coalesce") };
return name;
}
- table_map not_null_tables() const { return 0; }
- Item *get_copy(THD *thd)
+ table_map not_null_tables() const override { return 0; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_coalesce>(thd, this); }
};
@@ -1191,14 +1199,14 @@ class Item_func_ifnull :public Item_func_case_abbreviation2
public:
Item_func_ifnull(THD *thd, Item *a, Item *b):
Item_func_case_abbreviation2(thd, a, b) {}
- double real_op();
- longlong int_op();
- String *str_op(String *str);
- my_decimal *decimal_op(my_decimal *);
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- bool native_op(THD *thd, Native *to);
- bool fix_length_and_dec()
+ double real_op() override;
+ longlong int_op() override;
+ String *str_op(String *str) override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ bool native_op(THD *thd, Native *to) override;
+ bool fix_length_and_dec() override
{
/*
Set nullability from args[1] by default.
@@ -1221,8 +1229,8 @@ public:
return name;
}
- table_map not_null_tables() const { return 0; }
- Item *get_copy(THD *thd)
+ table_map not_null_tables() const override { return 0; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ifnull>(thd, this); }
};
@@ -1281,14 +1289,15 @@ public:
class Item_func_if :public Item_func_case_abbreviation2_switch
{
protected:
- Item *find_item() const { return args[0]->val_bool() ? args[1] : args[2]; }
+ Item *find_item() const override
+ { return args[0]->val_bool() ? args[1] : args[2]; }
public:
Item_func_if(THD *thd, Item *a, Item *b, Item *c):
Item_func_case_abbreviation2_switch(thd, a, b, c)
{}
- bool fix_fields(THD *, Item **);
- bool fix_length_and_dec()
+ bool fix_fields(THD *, Item **) override;
+ bool fix_length_and_dec() override
{
return fix_length_and_dec2_eliminate_null(args + 1);
}
@@ -1297,9 +1306,10 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("if") };
return name;
}
- bool eval_not_null_tables(void *opt_arg);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
- Item *get_copy(THD *thd)
+ bool eval_not_null_tables(void *opt_arg) override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
+ override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_if>(thd, this); }
private:
void cache_type_info(Item *source);
@@ -1309,7 +1319,8 @@ private:
class Item_func_nvl2 :public Item_func_case_abbreviation2_switch
{
protected:
- Item *find_item() const { return args[0]->is_null() ? args[2] : args[1]; }
+ Item *find_item() const override
+ { return args[0]->is_null() ? args[2] : args[1]; }
public:
Item_func_nvl2(THD *thd, Item *a, Item *b, Item *c):
@@ -1320,11 +1331,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("nvl2") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
return fix_length_and_dec2_eliminate_null(args + 1);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_nvl2>(thd, this); }
};
@@ -1371,32 +1382,33 @@ public:
m_cache(NULL),
m_arg0(NULL)
{ arg_count--; }
- void cleanup()
+ void cleanup() override
{
Item_func_hybrid_field_type::cleanup();
arg_count= 2; // See the comment to the constructor
}
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- double real_op();
- longlong int_op();
- String *str_op(String *str);
- my_decimal *decimal_op(my_decimal *);
- bool native_op(THD *thd, Native *to);
- bool fix_length_and_dec();
- bool walk(Item_processor processor, bool walk_subquery, void *arg);
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ double real_op() override;
+ longlong int_op() override;
+ String *str_op(String *str) override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool native_op(THD *thd, Native *to) override;
+ bool fix_length_and_dec() override;
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("nullif") };
return name;
}
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
- List<Item> &fields, uint flags);
- void update_used_tables();
- table_map not_null_tables() const { return 0; }
- bool is_null();
+ List<Item> &fields, uint flags) override;
+ void update_used_tables() override;
+ table_map not_null_tables() const override { return 0; }
+ bool is_null() override;
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
Context cmpctx(ANY_SUBST, cmp.compare_type_handler(),
cmp.compare_collation());
@@ -1417,17 +1429,17 @@ public:
cond, &args[2]);
return this;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_nullif>(thd, this); }
- Item *derived_field_transformer_for_having(THD *thd, uchar *arg)
+ Item *derived_field_transformer_for_having(THD *thd, uchar *arg) override
{ reset_first_arg_if_needed(); return this; }
- Item *derived_field_transformer_for_where(THD *thd, uchar *arg)
+ Item *derived_field_transformer_for_where(THD *thd, uchar *arg) override
{ reset_first_arg_if_needed(); return this; }
- Item *grouping_field_transformer_for_where(THD *thd, uchar *arg)
+ Item *grouping_field_transformer_for_where(THD *thd, uchar *arg) override
{ reset_first_arg_if_needed(); return this; }
- Item *in_subq_field_transformer_for_where(THD *thd, uchar *arg)
+ Item *in_subq_field_transformer_for_where(THD *thd, uchar *arg) override
{ reset_first_arg_if_needed(); return this; }
- Item *in_subq_field_transformer_for_having(THD *thd, uchar *arg)
+ Item *in_subq_field_transformer_for_having(THD *thd, uchar *arg) override
{ reset_first_arg_if_needed(); return this; }
};
@@ -1508,16 +1520,17 @@ class in_string :public in_vector
public:
in_string(THD *thd, uint elements, qsort2_cmp cmp_func, CHARSET_INFO *cs);
~in_string();
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
- Item* create_item(THD *thd);
- void value_to_item(uint pos, Item *item)
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
+ Item* create_item(THD *thd) override;
+ void value_to_item(uint pos, Item *item) override
{
String *str=((String*) base)+pos;
Item_string_for_in_vector *to= (Item_string_for_in_vector*) item;
to->set_value(str);
}
- const Type_handler *type_handler() const { return &type_handler_varchar; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_varchar; }
};
class in_longlong :public in_vector
@@ -1535,16 +1548,17 @@ protected:
} tmp;
public:
in_longlong(THD *thd, uint elements);
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
- Item* create_item(THD *thd);
- void value_to_item(uint pos, Item *item)
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
+ Item* create_item(THD *thd) override;
+ void value_to_item(uint pos, Item *item) override
{
((Item_int*) item)->value= ((packed_longlong*) base)[pos].val;
((Item_int*) item)->unsigned_flag= (bool)
((packed_longlong*) base)[pos].unsigned_flag;
}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
friend int cmp_longlong(void *cmp_arg, packed_longlong *a,packed_longlong *b);
};
@@ -1555,11 +1569,12 @@ class in_timestamp :public in_vector
Timestamp_or_zero_datetime tmp;
public:
in_timestamp(THD *thd, uint elements);
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
- Item* create_item(THD *thd);
- void value_to_item(uint pos, Item *item);
- const Type_handler *type_handler() const { return &type_handler_timestamp2; }
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
+ Item* create_item(THD *thd) override;
+ void value_to_item(uint pos, Item *item) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_timestamp2; }
};
@@ -1590,9 +1605,10 @@ public:
in_datetime(THD *thd, uint elements)
:in_temporal(thd, elements)
{}
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
- const Type_handler *type_handler() const { return &type_handler_datetime2; }
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_datetime2; }
};
@@ -1602,9 +1618,10 @@ public:
in_time(THD *thd, uint elements)
:in_temporal(thd, elements)
{}
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
- const Type_handler *type_handler() const { return &type_handler_time2; }
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_time2; }
};
@@ -1613,14 +1630,15 @@ class in_double :public in_vector
double tmp;
public:
in_double(THD *thd, uint elements);
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
- Item *create_item(THD *thd);
- void value_to_item(uint pos, Item *item)
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
+ Item *create_item(THD *thd) override;
+ void value_to_item(uint pos, Item *item) override
{
((Item_float*)item)->value= ((double*) base)[pos];
}
- const Type_handler *type_handler() const { return &type_handler_double; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
};
@@ -1629,16 +1647,17 @@ class in_decimal :public in_vector
my_decimal val;
public:
in_decimal(THD *thd, uint elements);
- void set(uint pos, Item *item);
- uchar *get_value(Item *item);
- Item *create_item(THD *thd);
- void value_to_item(uint pos, Item *item)
+ void set(uint pos, Item *item) override;
+ uchar *get_value(Item *item) override;
+ Item *create_item(THD *thd) override;
+ void value_to_item(uint pos, Item *item) override
{
my_decimal *dec= ((my_decimal *)base) + pos;
Item_decimal *item_dec= (Item_decimal*)item;
item_dec->set_decimal_value(dec);
}
- const Type_handler *type_handler() const { return &type_handler_newdecimal; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_newdecimal; }
};
@@ -2294,22 +2313,22 @@ public:
Item_func_case(THD *thd, List<Item> &list)
:Item_func_case_expression(thd, list)
{ }
- double real_op();
- longlong int_op();
- String *str_op(String *);
- my_decimal *decimal_op(my_decimal *);
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- bool native_op(THD *thd, Native *to);
- bool fix_fields(THD *thd, Item **ref);
- table_map not_null_tables() const { return 0; }
+ double real_op() override;
+ longlong int_op() override;
+ String *str_op(String *) override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ bool native_op(THD *thd, Native *to) override;
+ bool fix_fields(THD *thd, Item **ref) override;
+ table_map not_null_tables() const override { return 0; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("case") };
return name;
}
CHARSET_INFO *compare_collation() const { return cmp_collation.collation; }
- bool need_parentheses_in_default() { return true; }
+ bool need_parentheses_in_default() override { return true; }
};
@@ -2324,7 +2343,8 @@ class Item_func_case_searched: public Item_func_case
{
uint when_count() const { return arg_count / 2; }
bool with_else() const { return arg_count % 2; }
- Item **else_expr_addr() const { return with_else() ? &args[arg_count - 1] : 0; }
+ Item **else_expr_addr() const override
+ { return with_else() ? &args[arg_count - 1] : 0; }
public:
Item_func_case_searched(THD *thd, List<Item> &list)
:Item_func_case(thd, list)
@@ -2332,17 +2352,18 @@ public:
DBUG_ASSERT(arg_count >= 2);
reorder_args(0);
}
- enum Functype functype() const { return CASE_SEARCHED_FUNC; }
- void print(String *str, enum_query_type query_type);
- bool fix_length_and_dec();
+ enum Functype functype() const override { return CASE_SEARCHED_FUNC; }
+ void print(String *str, enum_query_type query_type) override;
+ bool fix_length_and_dec() override;
Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
// None of the arguments are in a comparison context
Item_args::propagate_equal_fields(thd, Context_identity(), cond);
return this;
}
- Item *find_item();
- Item *get_copy(THD *thd)
+ Item *find_item() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_case_searched>(thd, this); }
};
@@ -2365,7 +2386,8 @@ protected:
uint m_found_types;
uint when_count() const { return (arg_count - 1) / 2; }
bool with_else() const { return arg_count % 2 == 0; }
- Item **else_expr_addr() const { return with_else() ? &args[arg_count - 1] : 0; }
+ Item **else_expr_addr() const override
+ { return with_else() ? &args[arg_count - 1] : 0; }
bool aggregate_switch_and_when_arguments(THD *thd, bool nulls_equal);
bool prepare_predicant_and_values(THD *thd, uint *found_types,
bool nulls_equal);
@@ -2378,19 +2400,20 @@ public:
DBUG_ASSERT(arg_count >= 3);
reorder_args(1);
}
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_case_simple::cleanup");
Item_func::cleanup();
Predicant_to_list_comparator::cleanup();
DBUG_VOID_RETURN;
}
- enum Functype functype() const { return CASE_SIMPLE_FUNC; }
- void print(String *str, enum_query_type query_type);
- bool fix_length_and_dec();
- Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond);
- Item *find_item();
- Item *build_clone(THD *thd)
+ enum Functype functype() const override { return CASE_SIMPLE_FUNC; }
+ void print(String *str, enum_query_type query_type) override;
+ bool fix_length_and_dec() override;
+ Item *propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override;
+ Item *find_item() override;
+ Item *build_clone(THD *thd) override
{
Item_func_case_simple *clone= (Item_func_case_simple *)
Item_func_case::build_clone(thd);
@@ -2399,7 +2422,7 @@ public:
return NULL;
return clone;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_case_simple>(thd, this); }
};
@@ -2415,10 +2438,10 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("decode_oracle") };
return name;
}
- void print(String *str, enum_query_type query_type);
- bool fix_length_and_dec();
- Item *find_item();
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ bool fix_length_and_dec() override;
+ Item *find_item() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_decode_oracle>(thd, this); }
};
@@ -2469,13 +2492,13 @@ class Item_func_in :public Item_func_opt_neg,
return true;
}
bool prepare_predicant_and_values(THD *thd, uint *found_types);
- bool check_arguments() const
+ bool check_arguments() const override
{
return check_argument_types_like_args0();
}
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
- Field *field, Item *value);
+ Field *field, Item *value) override;
bool transform_into_subq;
public:
/// An array of values, created when the bisection lookup method is used
@@ -2502,9 +2525,9 @@ public:
array(0), have_null(0),
arg_types_compatible(FALSE), emb_on_expr_nest(0)
{ }
- longlong val_int();
- bool fix_fields(THD *, Item **);
- bool fix_length_and_dec();
+ longlong val_int() override;
+ bool fix_fields(THD *, Item **) override;
+ bool fix_length_and_dec() override;
bool compatible_types_scalar_bisection_possible()
{
DBUG_ASSERT(m_comparator.cmp_type() != ROW_RESULT);
@@ -2536,7 +2559,7 @@ public:
bool fix_for_row_comparison_using_cmp_items(THD *thd);
bool fix_for_row_comparison_using_bisection(THD *thd);
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_in::cleanup");
Item_int_func::cleanup();
@@ -2546,10 +2569,12 @@ public:
DBUG_VOID_RETURN;
}
void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
- table_map usable_tables, SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
+ table_map usable_tables, SARGABLE_PARAM **sargables)
+ override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
SEL_TREE *get_func_row_mm_tree(RANGE_OPT_PARAM *param, Item_row *key_row);
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
/*
Note, we pass ANY_SUBST, this makes sure that non of the args
@@ -2573,21 +2598,22 @@ public:
}
return this;
}
- virtual void print(String *str, enum_query_type query_type);
- enum Functype functype() const { return IN_FUNC; }
+ void print(String *str, enum_query_type query_type) override;
+ enum Functype functype() const override { return IN_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("in") };
return name;
}
- enum precedence precedence() const { return IN_PRECEDENCE; }
- bool eval_not_null_tables(void *opt_arg);
- bool find_not_null_fields(table_map allowed);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
- bool count_sargable_conds(void *arg);
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return IN_PRECEDENCE; }
+ bool eval_not_null_tables(void *opt_arg) override;
+ bool find_not_null_fields(table_map allowed) override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
+ override;
+ bool count_sargable_conds(void *arg) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_in>(thd, this); }
- Item *build_clone(THD *thd)
+ Item *build_clone(THD *thd) override
{
Item_func_in *clone= (Item_func_in *) Item_func::build_clone(thd);
if (clone)
@@ -2598,10 +2624,10 @@ public:
}
return clone;
}
- void mark_as_condition_AND_part(TABLE_LIST *embedding);
+ void mark_as_condition_AND_part(TABLE_LIST *embedding) override;
bool to_be_transformed_into_in_subq(THD *thd);
bool create_value_list_for_tvc(THD *thd, List< List<Item> > *values);
- Item *in_predicate_to_in_subs_transformer(THD *thd, uchar *arg);
+ Item *in_predicate_to_in_subs_transformer(THD *thd, uchar *arg) override;
uint32 max_length_of_left_expr();
};
@@ -2642,10 +2668,10 @@ class in_row :public in_vector
public:
in_row(THD *thd, uint elements, Item *);
~in_row();
- void set(uint pos,Item *item);
- uchar *get_value(Item *item);
+ void set(uint pos,Item *item) override;
+ uchar *get_value(Item *item) override;
friend class Item_func_in;
- const Type_handler *type_handler() const { return &type_handler_row; }
+ const Type_handler *type_handler() const override { return &type_handler_row; }
cmp_item *get_cmp_item() { return &tmp; }
};
@@ -2654,19 +2680,20 @@ class Item_func_null_predicate :public Item_bool_func
{
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
- Field *field, Item *value)
+ Field *field, Item *value) override
{
DBUG_ENTER("Item_func_null_predicate::get_func_mm_tree");
DBUG_RETURN(get_mm_parts(param, field, functype(), value));
}
SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
KEY_PART *key_part,
- Item_func::Functype type, Item *value);
+ Item_func::Functype type, Item *value) override;
public:
Item_func_null_predicate(THD *thd, Item *a): Item_bool_func(thd, a) { }
void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
- table_map usable_tables, SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
+ table_map usable_tables, SARGABLE_PARAM **sargables)
+ override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override
{
DBUG_ENTER("Item_func_null_predicate::get_mm_tree");
SEL_TREE *ftree= get_full_func_mm_tree_for_args(param, args[0], NULL);
@@ -2674,16 +2701,16 @@ public:
ftree= Item_func::get_mm_tree(param, cond_ptr);
DBUG_RETURN(ftree);
}
- CHARSET_INFO *compare_collation() const
+ CHARSET_INFO *compare_collation() const override
{ return args[0]->collation.collation; }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=1;
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
}
- bool count_sargable_conds(void *arg);
+ bool count_sargable_conds(void *arg) override;
};
@@ -2691,15 +2718,15 @@ class Item_func_isnull :public Item_func_null_predicate
{
public:
Item_func_isnull(THD *thd, Item *a): Item_func_null_predicate(thd, a) {}
- longlong val_int();
- enum Functype functype() const { return ISNULL_FUNC; }
+ longlong val_int() override;
+ enum Functype functype() const override { return ISNULL_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("isnull") };
return name;
}
- void print(String *str, enum_query_type query_type);
- enum precedence precedence() const { return CMP_PRECEDENCE; }
+ void print(String *str, enum_query_type query_type) override;
+ enum precedence precedence() const override { return CMP_PRECEDENCE; }
bool arg_is_datetime_notnull_field()
{
@@ -2716,7 +2743,7 @@ public:
}
/* Optimize case of not_null_column IS NULL */
- virtual void update_used_tables()
+ void update_used_tables() override
{
if (!args[0]->maybe_null() && !arg_is_datetime_notnull_field())
{
@@ -2731,11 +2758,11 @@ public:
}
}
COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
- bool top_level);
- table_map not_null_tables() const { return 0; }
- bool find_not_null_fields(table_map allowed);
- Item *neg_transformer(THD *thd);
- Item *get_copy(THD *thd)
+ bool top_level) override;
+ table_map not_null_tables() const override { return 0; }
+ bool find_not_null_fields(table_map allowed) override;
+ Item *neg_transformer(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isnull>(thd, this); }
};
@@ -2754,20 +2781,20 @@ public:
Item_is_not_null_test(THD *thd, Item_in_subselect* ow, Item *a):
Item_func_isnull(thd, a), owner(ow)
{}
- enum Functype functype() const { return ISNOTNULLTEST_FUNC; }
- longlong val_int();
+ enum Functype functype() const override { return ISNOTNULLTEST_FUNC; }
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<is_not_null_test>") };
return name;
}
- void update_used_tables();
+ void update_used_tables() override;
/*
we add RAND_TABLE_BIT to prevent moving this item from HAVING to WHERE
*/
- table_map used_tables() const
+ table_map used_tables() const override
{ return used_tables_cache | RAND_TABLE_BIT; }
- bool const_item() const { return FALSE; }
+ bool const_item() const override { return FALSE; }
};
@@ -2778,20 +2805,20 @@ public:
Item_func_isnotnull(THD *thd, Item *a):
Item_func_null_predicate(thd, a), abort_on_null(0)
{ }
- longlong val_int();
- enum Functype functype() const { return ISNOTNULL_FUNC; }
+ longlong val_int() override;
+ enum Functype functype() const override { return ISNOTNULL_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("isnotnull") };
return name;
}
- enum precedence precedence() const { return CMP_PRECEDENCE; }
- table_map not_null_tables() const
+ enum precedence precedence() const override { return CMP_PRECEDENCE; }
+ table_map not_null_tables() const override
{ return abort_on_null ? not_null_tables_cache : 0; }
- Item *neg_transformer(THD *thd);
- void print(String *str, enum_query_type query_type);
- void top_level_item() { abort_on_null=1; }
- Item *get_copy(THD *thd)
+ Item *neg_transformer(THD *thd) override;
+ void print(String *str, enum_query_type query_type) override;
+ void top_level_item() override { abort_on_null=1; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isnotnull>(thd, this); }
};
@@ -2823,14 +2850,14 @@ class Item_func_like :public Item_bool_func2
bool with_sargable_pattern() const;
protected:
SEL_TREE *get_func_mm_tree(RANGE_OPT_PARAM *param,
- Field *field, Item *value)
+ Field *field, Item *value) override
{
DBUG_ENTER("Item_func_like::get_func_mm_tree");
DBUG_RETURN(get_mm_parts(param, field, LIKE_FUNC, value));
}
SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
KEY_PART *key_part,
- Item_func::Functype type, Item *value);
+ Item_func::Functype type, Item *value) override;
public:
int escape;
bool negated;
@@ -2842,13 +2869,13 @@ public:
bool get_negated() const { return negated; } // Used by ColumnStore
- Sql_mode_dependency value_depends_on_sql_mode() const;
- longlong val_int();
- enum Functype functype() const { return LIKE_FUNC; }
- void print(String *str, enum_query_type query_type);
- CHARSET_INFO *compare_collation() const
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ longlong val_int() override;
+ enum Functype functype() const override { return LIKE_FUNC; }
+ void print(String *str, enum_query_type query_type) override;
+ CHARSET_INFO *compare_collation() const override
{ return cmp_collation.collation; }
- cond_result eq_cmp_result() const
+ cond_result eq_cmp_result() const override
{
/**
We cannot always rewrite conditions as follows:
@@ -2884,9 +2911,11 @@ public:
return compare_collation() == &my_charset_bin ? COND_TRUE : COND_OK;
}
void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
- table_map usable_tables, SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
+ table_map usable_tables, SARGABLE_PARAM **sargables)
+ override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
/*
LIKE differs from the regular comparison operator ('=') in the following:
@@ -2924,31 +2953,31 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("like") };
return name;
}
- enum precedence precedence() const { return IN_PRECEDENCE; }
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec()
+ enum precedence precedence() const override { return IN_PRECEDENCE; }
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override
{
max_length= 1;
return agg_arg_charsets_for_comparison(cmp_collation, args, 2);
}
- void cleanup();
+ void cleanup() override;
- Item *neg_transformer(THD *thd)
+ Item *neg_transformer(THD *thd) override
{
negated= !negated;
return this;
}
- bool walk(Item_processor processor, bool walk_subquery, void *arg)
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override
{
- return walk_args(processor, walk_subquery, arg)
- || escape_item->walk(processor, walk_subquery, arg)
- || (this->*processor)(arg);
+ return (walk_args(processor, walk_subquery, arg) ||
+ escape_item->walk(processor, walk_subquery, arg) ||
+ (this->*processor)(arg));
}
- bool find_selective_predicates_list_processor(void *arg);
+ bool find_selective_predicates_list_processor(void *arg) override;
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_like>(thd, this); }
};
@@ -3030,28 +3059,29 @@ class Item_func_regex :public Item_bool_func
public:
Item_func_regex(THD *thd, Item *a, Item *b): Item_bool_func(thd, a, b)
{}
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_regex::cleanup");
Item_bool_func::cleanup();
re.cleanup();
DBUG_VOID_RETURN;
}
- longlong val_int();
- bool fix_length_and_dec();
+ longlong val_int() override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("regexp") };
return name;
}
- enum precedence precedence() const { return IN_PRECEDENCE; }
- Item *get_copy(THD *) { return 0; }
- void print(String *str, enum_query_type query_type)
+ enum precedence precedence() const override { return IN_PRECEDENCE; }
+ Item *get_copy(THD *) override { return 0; }
+ void print(String *str, enum_query_type query_type) override
{
print_op(str, query_type);
}
- CHARSET_INFO *compare_collation() const { return cmp_collation.collation; }
+ CHARSET_INFO *compare_collation() const override
+ { return cmp_collation.collation; }
};
@@ -3063,7 +3093,7 @@ public:
*/
class Item_func_regexp_instr :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return (args[0]->check_type_can_return_str(func_name_cstring()) ||
args[1]->check_type_can_return_text(func_name_cstring()));
@@ -3074,21 +3104,21 @@ public:
Item_func_regexp_instr(THD *thd, Item *a, Item *b)
:Item_long_func(thd, a, b)
{}
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_regexp_instr::cleanup");
Item_int_func::cleanup();
re.cleanup();
DBUG_VOID_RETURN;
}
- longlong val_int();
- bool fix_length_and_dec();
+ longlong val_int() override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("regexp_instr") };
return name;
}
- Item *get_copy(THD *thd) { return 0; }
+ Item *get_copy(THD *thd) override { return 0; }
};
@@ -3129,46 +3159,47 @@ public:
DBUG_ASSERT(nlist->elements);
list.append(nlist);
}
- bool fix_fields(THD *, Item **ref);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
+ bool fix_fields(THD *, Item **ref) override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
+ override;
- enum Type type() const { return COND_ITEM; }
+ enum Type type() const override { return COND_ITEM; }
List<Item>* argument_list() { return &list; }
- table_map used_tables() const;
- void update_used_tables()
+ table_map used_tables() const override;
+ void update_used_tables() override
{
used_tables_and_const_cache_init();
used_tables_and_const_cache_update_and_join(list);
}
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
- COND_EQUAL **cond_equal_ref);
+ COND_EQUAL **cond_equal_ref) override;
COND *remove_eq_conds(THD *thd, Item::cond_result *cond_value,
- bool top_level);
+ bool top_level) override;
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
- virtual void print(String *str, enum_query_type query_type);
+ SARGABLE_PARAM **sargables) override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
+ void print(String *str, enum_query_type query_type) override;
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
- List<Item> &fields, uint flags);
+ List<Item> &fields, uint flags) override;
friend int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
COND **conds);
- void top_level_item() { abort_on_null=1; }
+ void top_level_item() override { abort_on_null=1; }
bool top_level() { return abort_on_null; }
void copy_andor_arguments(THD *thd, Item_cond *item);
- bool walk(Item_processor processor, bool walk_subquery, void *arg);
- Item *transform(THD *thd, Item_transformer transformer, uchar *arg);
- void traverse_cond(Cond_traverser, void *arg, traverse_order order);
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
+ Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
+ void traverse_cond(Cond_traverser, void *arg, traverse_order order) override;
void neg_arguments(THD *thd);
- Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *);
+ Item* propagate_equal_fields(THD *, const Context &, COND_EQUAL *) override;
Item *compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
- Item_transformer transformer, uchar *arg_t);
- bool eval_not_null_tables(void *opt_arg);
- bool find_not_null_fields(table_map allowed);
- Item *build_clone(THD *thd);
- bool excl_dep_on_table(table_map tab_map);
- bool excl_dep_on_grouping_fields(st_select_lex *sel);
+ Item_transformer transformer, uchar *arg_t) override;
+ bool eval_not_null_tables(void *opt_arg) override;
+ bool find_not_null_fields(table_map allowed) override;
+ Item *build_clone(THD *thd) override;
+ bool excl_dep_on_table(table_map tab_map) override;
+ bool excl_dep_on_grouping_fields(st_select_lex *sel) override;
};
template <template<class> class LI, class T> class Item_equal_iterator;
@@ -3319,57 +3350,58 @@ public:
void merge_into_list(THD *thd, List<Item_equal> *list, bool save_merged,
bool only_intersected);
void update_const(THD *thd);
- enum Functype functype() const { return MULT_EQUAL_FUNC; }
- longlong val_int();
+ enum Functype functype() const override { return MULT_EQUAL_FUNC; }
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("multiple equal") };
return name;
}
void sort(Item_field_cmpfunc compare, void *arg);
- bool fix_length_and_dec();
- bool fix_fields(THD *thd, Item **ref);
- void cleanup()
+ bool fix_length_and_dec() override;
+ bool fix_fields(THD *thd, Item **ref) override;
+ void cleanup() override
{
delete eval_item;
eval_item= NULL;
}
- void update_used_tables();
- bool find_not_null_fields(table_map allowed);
+ void update_used_tables() override;
+ bool find_not_null_fields(table_map allowed) override;
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
- COND_EQUAL **cond_equal_ref);
+ COND_EQUAL **cond_equal_ref) override;
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
- bool walk(Item_processor processor, bool walk_subquery, void *arg);
- Item *transform(THD *thd, Item_transformer transformer, uchar *arg);
- virtual void print(String *str, enum_query_type query_type);
+ SARGABLE_PARAM **sargables) override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override;
+ Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
+ void print(String *str, enum_query_type query_type) override;
const Type_handler *compare_type_handler() const { return m_compare_handler; }
- CHARSET_INFO *compare_collation() const { return m_compare_collation; }
+ CHARSET_INFO *compare_collation() const override
+ { return m_compare_collation; }
void set_context_field(Item_field *ctx_field) { context_field= ctx_field; }
void set_link_equal_fields(bool flag) { link_equal_fields= flag; }
- Item* get_copy(THD *thd) { return 0; }
+ Item* get_copy(THD *thd) override { return 0; }
/*
This does not comply with the specification of the virtual method,
but Item_equal items are processed distinguishly anyway
*/
- bool excl_dep_on_table(table_map tab_map)
+ bool excl_dep_on_table(table_map tab_map) override
{
return used_tables() & tab_map;
}
- bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred);
- bool excl_dep_on_grouping_fields(st_select_lex *sel);
+ bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override;
+ bool excl_dep_on_grouping_fields(st_select_lex *sel) override;
bool create_pushable_equalities(THD *thd, List<Item> *equalities,
Pushdown_checker checker, uchar *arg,
bool clone_const);
/* Return the number of elements in this multiple equality */
uint elements_count() { return equal_items.elements; }
friend class Item_equal_fields_iterator;
- bool count_sargable_conds(void *arg);
- Item *multiple_equality_transformer(THD *thd, uchar *arg);
+ bool count_sargable_conds(void *arg) override;
+ Item *multiple_equality_transformer(THD *thd, uchar *arg) override;
friend class Item_equal_iterator<List_iterator_fast,Item>;
friend class Item_equal_iterator<List_iterator,Item>;
friend Item *eliminate_item_equal(THD *thd, COND *cond,
@@ -3501,28 +3533,30 @@ public:
Item_cond_and(THD *thd, Item *i1,Item *i2): Item_cond(thd, i1, i2) {}
Item_cond_and(THD *thd, Item_cond_and *item): Item_cond(thd, item) {}
Item_cond_and(THD *thd, List<Item> &list_arg): Item_cond(thd, list_arg) {}
- enum Functype functype() const { return COND_AND_FUNC; }
- longlong val_int();
+ enum Functype functype() const override { return COND_AND_FUNC; }
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("and") };
return name;
}
- enum precedence precedence() const { return AND_PRECEDENCE; }
- table_map not_null_tables() const
+ enum precedence precedence() const override { return AND_PRECEDENCE; }
+ table_map not_null_tables() const override
{ return abort_on_null ? not_null_tables_cache: and_tables_cache; }
- Item *copy_andor_structure(THD *thd);
- Item *neg_transformer(THD *thd);
- void mark_as_condition_AND_part(TABLE_LIST *embedding);
- virtual uint exists2in_reserved_items() { return list.elements; };
+ Item *copy_andor_structure(THD *thd) override;
+ Item *neg_transformer(THD *thd) override;
+ void mark_as_condition_AND_part(TABLE_LIST *embedding) override;
+ uint exists2in_reserved_items() override { return list.elements; };
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
- COND_EQUAL **cond_equal_ref);
- bool set_format_by_check_constraint(Send_field_extended_metadata *to) const;
+ COND_EQUAL **cond_equal_ref) override;
+ bool set_format_by_check_constraint(Send_field_extended_metadata *to) const
+ override;
void add_key_fields(JOIN *join, KEY_FIELD **key_fields, uint *and_level,
- table_map usable_tables, SARGABLE_PARAM **sargables);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr);
- Item *get_copy(THD *thd)
+ table_map usable_tables, SARGABLE_PARAM **sargables)
+ override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_cond_and>(thd, this); }
};
@@ -3539,18 +3573,18 @@ public:
Item_cond_or(THD *thd, Item *i1,Item *i2): Item_cond(thd, i1, i2) {}
Item_cond_or(THD *thd, Item_cond_or *item): Item_cond(thd, item) {}
Item_cond_or(THD *thd, List<Item> &list_arg): Item_cond(thd, list_arg) {}
- enum Functype functype() const { return COND_OR_FUNC; }
- longlong val_int();
+ enum Functype functype() const override { return COND_OR_FUNC; }
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("or") };
return name;
}
- enum precedence precedence() const { return OR_PRECEDENCE; }
- table_map not_null_tables() const { return and_tables_cache; }
- Item *copy_andor_structure(THD *thd);
- Item *neg_transformer(THD *thd);
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return OR_PRECEDENCE; }
+ table_map not_null_tables() const override { return and_tables_cache; }
+ Item *copy_andor_structure(THD *thd) override;
+ Item *neg_transformer(THD *thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_cond_or>(thd, this); }
};
@@ -3558,14 +3592,14 @@ class Item_func_dyncol_check :public Item_bool_func
{
public:
Item_func_dyncol_check(THD *thd, Item *str): Item_bool_func(thd, str) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("column_check") };
return name;
}
- bool need_parentheses_in_default() { return false; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return false; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dyncol_check>(thd, this); }
};
@@ -3574,14 +3608,14 @@ class Item_func_dyncol_exists :public Item_bool_func
public:
Item_func_dyncol_exists(THD *thd, Item *str, Item *num):
Item_bool_func(thd, str, num) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("column_exists") };
return name;
}
- bool need_parentheses_in_default() { return false; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return false; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dyncol_exists>(thd, this); }
};
@@ -3613,8 +3647,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("%ISOPEN") };
return name;
}
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_cursor_isopen>(thd, this); }
};
@@ -3632,8 +3666,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("%FOUND") };
return name;
}
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_cursor_found>(thd, this); }
};
@@ -3651,8 +3685,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("%NOTFOUND") };
return name;
}
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_cursor_notfound>(thd, this); }
};
diff --git a/sql/item_func.h b/sql/item_func.h
index 7a4a9c60f01..b532a1b1732 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -1,7 +1,7 @@
#ifndef ITEM_FUNC_INCLUDED
#define ITEM_FUNC_INCLUDED
/* Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2020, MariaDB
+ Copyright (c) 2009, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -93,7 +93,7 @@ public:
DBUG_ASSERT(0);
return SCALAR_CMP_EQ;
}
- enum Type type() const { return FUNC_ITEM; }
+ enum Type type() const override { return FUNC_ITEM; }
virtual enum Functype functype() const { return UNKNOWN_FUNC; }
Item_func(THD *thd): Item_func_or_sum(thd)
{
@@ -135,8 +135,8 @@ public:
Item_func_or_sum(thd, item),
not_null_tables_cache(item->not_null_tables_cache)
{ }
- bool fix_fields(THD *, Item **ref);
- void cleanup()
+ bool fix_fields(THD *, Item **ref) override;
+ void cleanup() override
{
Item_func_or_sum::cleanup();
used_tables_and_const_cache_init();
@@ -152,13 +152,13 @@ public:
}
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
- COND_EQUAL **cond_equal_ref);
- SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr)
+ COND_EQUAL **cond_equal_ref) override;
+ SEL_TREE *get_mm_tree(RANGE_OPT_PARAM *param, Item **cond_ptr) override
{
DBUG_ENTER("Item_func::get_mm_tree");
DBUG_RETURN(const_item() ? get_mm_tree_for_const(param) : NULL);
}
- bool eq(const Item *item, bool binary_cmp) const;
+ bool eq(const Item *item, bool binary_cmp) const override;
virtual Item *key_item() const { return args[0]; }
void set_arguments(THD *thd, List<Item> &list)
{
@@ -167,11 +167,12 @@ public:
list.empty(); // Fields are used
}
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
- List<Item> &fields, uint flags);
+ List<Item> &fields, uint flags) override;
void print(String *str, enum_query_type query_type) override;
void print_op(String *str, enum_query_type query_type);
void print_args(String *str, uint from, enum_query_type query_type);
- bool is_null() {
+ bool is_null() override
+ {
update_null_value();
return null_value;
}
@@ -179,9 +180,9 @@ public:
void signal_divide_by_null();
friend class udf_handler;
- Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
+ Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
{ return tmp_table_field_from_field_type(root, table); }
- Item *get_tmp_table_item(THD *thd);
+ Item *get_tmp_table_item(THD *thd) override;
void fix_char_length_ulonglong(ulonglong max_char_length_arg)
{
@@ -195,13 +196,13 @@ public:
else
max_length= (uint32) max_result_length;
}
- Item *transform(THD *thd, Item_transformer transformer, uchar *arg);
+ Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
Item* compile(THD *thd, Item_analyzer analyzer, uchar **arg_p,
- Item_transformer transformer, uchar *arg_t);
+ Item_transformer transformer, uchar *arg_t) override;
void traverse_cond(Cond_traverser traverser,
- void * arg, traverse_order order);
- bool eval_not_null_tables(void *opt_arg);
- bool find_not_null_fields(table_map allowed);
+ void * arg, traverse_order order) override;
+ bool eval_not_null_tables(void *opt_arg) override;
+ bool find_not_null_fields(table_map allowed) override;
// bool is_expensive_processor(void *arg);
// virtual bool is_expensive() { return 0; }
inline void raise_numeric_overflow(const char *type_name)
@@ -307,6 +308,7 @@ public:
}
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
/*
By default only substitution for a field whose two different values
@@ -322,7 +324,7 @@ public:
return used_tables() & RAND_TABLE_BIT;
}
- bool excl_dep_on_table(table_map tab_map)
+ bool excl_dep_on_table(table_map tab_map) override
{
if (used_tables() & OUTER_REF_TABLE_BIT)
return false;
@@ -330,14 +332,14 @@ public:
Item_args::excl_dep_on_table(tab_map);
}
- bool excl_dep_on_grouping_fields(st_select_lex *sel)
+ bool excl_dep_on_grouping_fields(st_select_lex *sel) override
{
if (has_rand_bit() || with_subquery())
return false;
return Item_args::excl_dep_on_grouping_fields(sel);
}
- bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred)
+ bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override
{
return Item_args::excl_dep_on_in_subq_left_part(subq_pred);
}
@@ -350,24 +352,24 @@ public:
representation of a TIMESTAMP argument verbatim, and thus does not depend on
the timezone.
*/
- virtual bool check_valid_arguments_processor(void *bool_arg)
+ bool check_valid_arguments_processor(void *bool_arg) override
{
return has_timestamp_args();
}
- virtual bool find_function_processor (void *arg)
+ bool find_function_processor (void *arg) override
{
return functype() == *(Functype *) arg;
}
- void no_rows_in_result()
+ void no_rows_in_result() override
{
for (uint i= 0; i < arg_count; i++)
{
args[i]->no_rows_in_result();
}
}
- void restore_to_before_no_rows_in_result()
+ void restore_to_before_no_rows_in_result() override
{
for (uint i= 0; i < arg_count; i++)
{
@@ -384,8 +386,8 @@ public:
- or replaced to an Item_int_with_ref
*/
bool setup_args_and_comparator(THD *thd, Arg_comparator *cmp);
- Item_func *get_item_func() { return this; }
- bool is_simplified_cond_processor(void *arg)
+ Item_func *get_item_func() override { return this; }
+ bool is_simplified_cond_processor(void *arg) override
{ return const_item() && !val_int(); }
};
@@ -400,17 +402,18 @@ public:
{ collation= DTCollation_numeric(); }
Item_real_func(THD *thd, List<Item> &list): Item_func(thd, list)
{ collation= DTCollation_numeric(); }
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *decimal_value);
- longlong val_int()
+ String *val_str(String*str) override;
+ my_decimal *val_decimal(my_decimal *decimal_value) override;
+ longlong val_int() override
{
DBUG_ASSERT(fixed());
return Converter_double_to_longlong(val_real(), unsigned_flag).result();
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{ return get_date_from_real(thd, ltime, fuzzydate); }
- const Type_handler *type_handler() const { return &type_handler_double; }
- bool fix_length_and_dec()
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ bool fix_length_and_dec() override
{
decimals= NOT_FIXED_DEC;
max_length= float_length(decimals);
@@ -436,7 +439,7 @@ public:
Item_hybrid_func(THD *thd, List<Item> &list): Item_func(thd, list) { }
Item_hybrid_func(THD *thd, Item_hybrid_func *item)
:Item_func(thd, item), Type_handler_hybrid_field_type(item) { }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{ return Type_handler_hybrid_field_type::type_handler(); }
void fix_length_and_dec_long_or_longlong(uint char_length, bool unsigned_arg)
{
@@ -750,11 +753,11 @@ public:
{
m_func_handler= handler;
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return m_func_handler->return_type_handler(this);
}
- Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
+ Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
{
DBUG_ASSERT(fixed());
const Type_handler *h= m_func_handler->type_handler_for_create_select(this);
@@ -762,31 +765,31 @@ public:
Record_addr(maybe_null()),
*this, table);
}
- String *val_str(String *to)
+ String *val_str(String *to) override
{
return m_func_handler->val_str(this, to);
}
- String *val_str_ascii(String *to)
+ String *val_str_ascii(String *to) override
{
return m_func_handler->val_str_ascii(this, to);
}
- double val_real()
+ double val_real() override
{
return m_func_handler->val_real(this);
}
- longlong val_int()
+ longlong val_int() override
{
return m_func_handler->val_int(this);
}
- my_decimal *val_decimal(my_decimal *to)
+ my_decimal *val_decimal(my_decimal *to) override
{
return m_func_handler->val_decimal(this, to);
}
- bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t fuzzydate) override
{
return m_func_handler->get_date(thd, this, to, fuzzydate);
}
- bool val_native(THD *thd, Native *to)
+ bool val_native(THD *thd, Native *to) override
{
return m_func_handler->val_native(thd, this, to);
}
@@ -889,25 +892,25 @@ public:
Item_hybrid_func(thd, list)
{ collation= DTCollation_numeric(); }
- double val_real()
+ double val_real() override
{
DBUG_ASSERT(fixed());
return Item_func_hybrid_field_type::type_handler()->
Item_func_hybrid_field_type_val_real(this);
}
- longlong val_int()
+ longlong val_int() override
{
DBUG_ASSERT(fixed());
return Item_func_hybrid_field_type::type_handler()->
Item_func_hybrid_field_type_val_int(this);
}
- my_decimal *val_decimal(my_decimal *dec)
+ my_decimal *val_decimal(my_decimal *dec) override
{
DBUG_ASSERT(fixed());
return Item_func_hybrid_field_type::type_handler()->
Item_func_hybrid_field_type_val_decimal(this, dec);
}
- String *val_str(String*str)
+ String *val_str(String*str) override
{
DBUG_ASSERT(fixed());
String *res= Item_func_hybrid_field_type::type_handler()->
@@ -915,14 +918,14 @@ public:
DBUG_ASSERT(null_value == (res == NULL));
return res;
}
- bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode)
+ bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override
{
DBUG_ASSERT(fixed());
return Item_func_hybrid_field_type::type_handler()->
Item_func_hybrid_field_type_get_date_with_warn(thd, this, to, mode);
}
- bool val_native(THD *thd, Native *to)
+ bool val_native(THD *thd, Native *to) override
{
DBUG_ASSERT(fixed());
return native_op(thd, to);
@@ -1090,7 +1093,7 @@ public:
class Item_num_op :public Item_func_numhybrid
{
protected:
- bool check_arguments() const
+ bool check_arguments() const override
{
return false; // Checked by aggregate_for_num_op()
}
@@ -1098,7 +1101,7 @@ public:
Item_num_op(THD *thd, Item *a, Item *b): Item_func_numhybrid(thd, a, b) {}
virtual void result_precision()= 0;
- virtual inline void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
print_op(str, query_type);
}
@@ -1128,7 +1131,7 @@ public:
if (decimals == 0 && downcast_decimal_to_int)
set_handler(type_handler_long_or_longlong());
}
- bool need_parentheses_in_default() { return true; }
+ bool need_parentheses_in_default() override { return true; }
};
@@ -1156,16 +1159,16 @@ public:
{ collation= DTCollation_numeric(); fix_char_length(21); }
Item_int_func(THD *thd, Item_int_func *item) :Item_func(thd, item)
{ collation= DTCollation_numeric(); }
- double val_real();
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *decimal_value)
+ double val_real() override;
+ String *val_str(String*str) override;
+ my_decimal *val_decimal(my_decimal *decimal_value) override
{
return val_decimal_from_int(decimal_value);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{ return get_date_from_int(thd, ltime, fuzzydate); }
- const Type_handler *type_handler() const= 0;
- bool fix_length_and_dec() { return FALSE; }
+ const Type_handler *type_handler() const override= 0;
+ bool fix_length_and_dec() override { return FALSE; }
};
@@ -1178,13 +1181,13 @@ public:
Item_long_func(THD *thd, Item *a, Item *b, Item *c): Item_int_func(thd, a, b, c) {}
Item_long_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
Item_long_func(THD *thd, Item_long_func *item) :Item_int_func(thd, item) {}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
if (unsigned_flag)
return &type_handler_ulong;
return &type_handler_slong;
}
- bool fix_length_and_dec() { max_length= 11; return FALSE; }
+ bool fix_length_and_dec() override { max_length= 11; return FALSE; }
};
@@ -1193,10 +1196,11 @@ class Item_func_hash: public Item_int_func
public:
Item_func_hash(THD *thd, List<Item> &item): Item_int_func(thd, item)
{}
- longlong val_int();
- bool fix_length_and_dec();
- const Type_handler *type_handler() const { return &type_handler_slong; }
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ bool fix_length_and_dec() override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_slong; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_hash>(thd, this); }
LEX_CSTRING func_name_cstring() const override
{
@@ -1216,7 +1220,7 @@ public:
Item_int_func(thd, a, b, c, d) {}
Item_longlong_func(THD *thd, List<Item> &list): Item_int_func(thd, list) { }
Item_longlong_func(THD *thd, Item_longlong_func *item) :Item_int_func(thd, item) {}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
if (unsigned_flag)
return &type_handler_ulonglong;
@@ -1253,16 +1257,16 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("%ROWCOUNT") };
return name;
}
- longlong val_int();
- bool check_vcol_func_processor(void *arg)
+ longlong val_int() override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), arg, VCOL_SESSION_FUNC);
}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
return Cursor_ref::print_func(str, func_name_cstring());
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_cursor_rowcount>(thd, this); }
};
@@ -1279,15 +1283,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("connection_id") };
return name;
}
- bool fix_length_and_dec();
- bool fix_fields(THD *thd, Item **ref);
- longlong val_int() { DBUG_ASSERT(fixed()); return value; }
- bool check_vcol_func_processor(void *arg)
+ bool fix_length_and_dec() override;
+ bool fix_fields(THD *thd, Item **ref) override;
+ longlong val_int() override { DBUG_ASSERT(fixed()); return value; }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_SESSION_FUNC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_connection_id>(thd, this); }
};
@@ -1304,12 +1308,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_signed") };
return name;
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return Type_handler::type_handler_long_or_longlong(max_char_length(),
false);
}
- longlong val_int()
+ longlong val_int() override
{
longlong value= args[0]->val_int_signed_typecast();
null_value= args[0]->null_value;
@@ -1344,15 +1348,15 @@ public:
set_if_bigger(char_length, 1U + (unsigned_flag ? 0 : 1));
fix_char_length(char_length);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
return args[0]->type_handler()->Item_func_signed_fix_length_and_dec(this);
}
- virtual void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
decimal_digits_t decimal_precision() const override
{ return args[0]->decimal_precision(); }
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_signed>(thd, this); }
};
@@ -1369,25 +1373,25 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_unsigned") };
return name;
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
if (max_char_length() <= MY_INT32_NUM_DECIMAL_DIGITS - 1)
return &type_handler_ulong;
return &type_handler_ulonglong;
}
- longlong val_int()
+ longlong val_int() override
{
longlong value= args[0]->val_int_unsigned_typecast();
null_value= args[0]->null_value;
return value;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
return args[0]->type_handler()->Item_func_unsigned_fix_length_and_dec(this);
}
decimal_digits_t decimal_precision() const override { return max_length; }
- virtual void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_unsigned>(thd, this); }
};
@@ -1404,18 +1408,19 @@ public:
fix_char_length(my_decimal_precision_to_length_no_truncation(len, dec,
unsigned_flag));
}
- String *val_str(String *str) { return VDec(this).to_string(str); }
- double val_real() { return VDec(this).to_double(); }
- longlong val_int() { return VDec(this).to_longlong(unsigned_flag); }
- my_decimal *val_decimal(my_decimal*);
- bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode)
+ String *val_str(String *str) override { return VDec(this).to_string(str); }
+ double val_real() override { return VDec(this).to_double(); }
+ longlong val_int() override { return VDec(this).to_longlong(unsigned_flag); }
+ my_decimal *val_decimal(my_decimal*) override;
+ bool get_date(THD *thd, MYSQL_TIME *to, date_mode_t mode) override
{
return decimal_to_datetime_with_warn(thd, VDec(this).ptr(), to, mode,
NULL, NULL);
}
- const Type_handler *type_handler() const { return &type_handler_newdecimal; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_newdecimal; }
void fix_length_and_dec_generic() {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
return
args[0]->type_handler()->Item_decimal_typecast_fix_length_and_dec(this);
@@ -1425,9 +1430,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("decimal_typecast") };
return name;
}
- virtual void print(String *str, enum_query_type query_type);
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_decimal_typecast>(thd, this); }
};
@@ -1458,8 +1463,9 @@ public:
Item_float_typecast(THD *thd, Item *a)
:Item_real_typecast(thd, a, MAX_FLOAT_STR_LENGTH, NOT_FIXED_DEC)
{ }
- const Type_handler *type_handler() const { return &type_handler_float; }
- bool fix_length_and_dec()
+ const Type_handler *type_handler() const override
+ { return &type_handler_float; }
+ bool fix_length_and_dec() override
{
return
args[0]->type_handler()->Item_float_typecast_fix_length_and_dec(this);
@@ -1469,11 +1475,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("float_typecast") };
return name;
}
- double val_real()
+ double val_real() override
{
return (double) (float) val_real_with_truncate(FLT_MAX);
}
- String *val_str(String*str)
+ String *val_str(String*str) override
{
Float nr(Item_float_typecast::val_real());
if (null_value)
@@ -1481,7 +1487,7 @@ public:
nr.to_string(str, decimals);
return str;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_float_typecast>(thd, this); }
};
@@ -1492,7 +1498,7 @@ public:
Item_double_typecast(THD *thd, Item *a, uint len, uint dec):
Item_real_typecast(thd, a, len, dec)
{ }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
return
args[0]->type_handler()->Item_double_typecast_fix_length_and_dec(this);
@@ -1502,8 +1508,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("double_typecast") };
return name;
}
- double val_real() { return val_real_with_truncate(DBL_MAX); }
- Item *get_copy(THD *thd)
+ double val_real() override { return val_real_with_truncate(DBL_MAX); }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_double_typecast>(thd, this); }
};
@@ -1528,12 +1534,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("+") };
return name;
}
- enum precedence precedence() const { return ADD_PRECEDENCE; }
- bool fix_length_and_dec();
- longlong int_op();
- double real_op();
- my_decimal *decimal_op(my_decimal *);
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return ADD_PRECEDENCE; }
+ bool fix_length_and_dec() override;
+ longlong int_op() override;
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_plus>(thd, this); }
};
@@ -1550,12 +1556,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("-") };
return name;
}
- enum precedence precedence() const { return ADD_PRECEDENCE; }
- Sql_mode_dependency value_depends_on_sql_mode() const;
- longlong int_op();
- double real_op();
- my_decimal *decimal_op(my_decimal *);
- bool fix_length_and_dec();
+ enum precedence precedence() const override { return ADD_PRECEDENCE; }
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ longlong int_op() override;
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool fix_length_and_dec() override;
void fix_unsigned_flag();
void fix_length_and_dec_double()
{
@@ -1572,7 +1578,7 @@ public:
Item_func_additive_op::fix_length_and_dec_int();
fix_unsigned_flag();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_minus>(thd, this); }
};
@@ -1587,15 +1593,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("*") };
return name;
}
- enum precedence precedence() const { return MUL_PRECEDENCE; }
- longlong int_op();
- double real_op();
- my_decimal *decimal_op(my_decimal *);
- void result_precision();
- bool fix_length_and_dec();
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return MUL_PRECEDENCE; }
+ longlong int_op() override;
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
+ void result_precision() override;
+ bool fix_length_and_dec() override;
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_mul>(thd, this); }
};
@@ -1605,20 +1611,20 @@ class Item_func_div :public Item_num_op
public:
uint prec_increment;
Item_func_div(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {}
- longlong int_op() { DBUG_ASSERT(0); return 0; }
- double real_op();
- my_decimal *decimal_op(my_decimal *);
+ longlong int_op() override { DBUG_ASSERT(0); return 0; }
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("/") };
return name;
}
- enum precedence precedence() const { return MUL_PRECEDENCE; }
- bool fix_length_and_dec();
+ enum precedence precedence() const override { return MUL_PRECEDENCE; }
+ bool fix_length_and_dec() override;
void fix_length_and_dec_double();
void fix_length_and_dec_int();
- void result_precision();
- Item *get_copy(THD *thd)
+ void result_precision() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_div>(thd, this); }
};
@@ -1628,25 +1634,25 @@ class Item_func_int_div :public Item_int_func
public:
Item_func_int_div(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b)
{}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("DIV") };
return name;
}
- enum precedence precedence() const { return MUL_PRECEDENCE; }
- const Type_handler *type_handler() const
+ enum precedence precedence() const override { return MUL_PRECEDENCE; }
+ const Type_handler *type_handler() const override
{ return type_handler_long_or_longlong(); }
- bool fix_length_and_dec();
- void print(String *str, enum_query_type query_type)
+ bool fix_length_and_dec() override;
+ void print(String *str, enum_query_type query_type) override
{
print_op(str, query_type);
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_int_div>(thd, this); }
};
@@ -1655,17 +1661,17 @@ class Item_func_mod :public Item_num_op
{
public:
Item_func_mod(THD *thd, Item *a, Item *b): Item_num_op(thd, a, b) {}
- longlong int_op();
- double real_op();
- my_decimal *decimal_op(my_decimal *);
+ longlong int_op() override;
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("MOD") };
return name;
}
- enum precedence precedence() const { return MUL_PRECEDENCE; }
- void result_precision();
- bool fix_length_and_dec();
+ enum precedence precedence() const override { return MUL_PRECEDENCE; }
+ void result_precision() override;
+ bool fix_length_and_dec() override;
void fix_length_and_dec_double()
{
Item_num_op::fix_length_and_dec_double();
@@ -1682,9 +1688,9 @@ public:
DBUG_ASSERT(decimals == 0);
set_handler(type_handler_long_or_longlong());
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- Item *get_copy(THD *thd)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_mod>(thd, this); }
};
@@ -1693,17 +1699,17 @@ class Item_func_neg :public Item_func_num1
{
public:
Item_func_neg(THD *thd, Item *a): Item_func_num1(thd, a) {}
- double real_op();
- longlong int_op();
- my_decimal *decimal_op(my_decimal *);
+ double real_op() override;
+ longlong int_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("-") };
return name;
}
- enum Functype functype() const { return NEG_FUNC; }
- enum precedence precedence() const { return NEG_PRECEDENCE; }
- void print(String *str, enum_query_type query_type)
+ enum Functype functype() const override { return NEG_FUNC; }
+ enum precedence precedence() const override { return NEG_PRECEDENCE; }
+ void print(String *str, enum_query_type query_type) override
{
str->append(func_name_cstring());
args[0]->print_parenthesised(str, query_type, precedence());
@@ -1711,11 +1717,11 @@ public:
void fix_length_and_dec_int();
void fix_length_and_dec_double();
void fix_length_and_dec_decimal();
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
decimal_digits_t decimal_precision() const override
{ return args[0]->decimal_precision(); }
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_neg>(thd, this); }
};
@@ -1724,9 +1730,9 @@ class Item_func_abs :public Item_func_num1
{
public:
Item_func_abs(THD *thd, Item *a): Item_func_num1(thd, a) {}
- double real_op();
- longlong int_op();
- my_decimal *decimal_op(my_decimal *);
+ double real_op() override;
+ longlong int_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("abs") };
@@ -1735,8 +1741,8 @@ public:
void fix_length_and_dec_int();
void fix_length_and_dec_double();
void fix_length_and_dec_decimal();
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_abs>(thd, this); }
};
@@ -1744,12 +1750,12 @@ public:
class Item_dec_func :public Item_real_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_real(0, arg_count); }
public:
Item_dec_func(THD *thd, Item *a): Item_real_func(thd, a) {}
Item_dec_func(THD *thd, Item *a, Item *b): Item_real_func(thd, a, b) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= NOT_FIXED_DEC;
max_length= float_length(decimals);
@@ -1762,13 +1768,13 @@ class Item_func_exp :public Item_dec_func
{
public:
Item_func_exp(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("exp") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_exp>(thd, this); }
};
@@ -1777,13 +1783,13 @@ class Item_func_ln :public Item_dec_func
{
public:
Item_func_ln(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("ln") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ln>(thd, this); }
};
@@ -1793,13 +1799,13 @@ class Item_func_log :public Item_dec_func
public:
Item_func_log(THD *thd, Item *a): Item_dec_func(thd, a) {}
Item_func_log(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("log") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_log>(thd, this); }
};
@@ -1808,13 +1814,13 @@ class Item_func_log2 :public Item_dec_func
{
public:
Item_func_log2(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("log2") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_log2>(thd, this); }
};
@@ -1823,13 +1829,13 @@ class Item_func_log10 :public Item_dec_func
{
public:
Item_func_log10(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("log10") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_log10>(thd, this); }
};
@@ -1838,13 +1844,13 @@ class Item_func_sqrt :public Item_dec_func
{
public:
Item_func_sqrt(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("sqrt") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sqrt>(thd, this); }
};
@@ -1853,13 +1859,13 @@ class Item_func_pow :public Item_dec_func
{
public:
Item_func_pow(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("pow") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_pow>(thd, this); }
};
@@ -1868,13 +1874,13 @@ class Item_func_acos :public Item_dec_func
{
public:
Item_func_acos(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("acos") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_acos>(thd, this); }
};
@@ -1882,13 +1888,13 @@ class Item_func_asin :public Item_dec_func
{
public:
Item_func_asin(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("asin") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_asin>(thd, this); }
};
@@ -1897,13 +1903,13 @@ class Item_func_atan :public Item_dec_func
public:
Item_func_atan(THD *thd, Item *a): Item_dec_func(thd, a) {}
Item_func_atan(THD *thd, Item *a, Item *b): Item_dec_func(thd, a, b) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("atan") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_atan>(thd, this); }
};
@@ -1911,13 +1917,13 @@ class Item_func_cos :public Item_dec_func
{
public:
Item_func_cos(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("cos") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_cos>(thd, this); }
};
@@ -1925,13 +1931,13 @@ class Item_func_sin :public Item_dec_func
{
public:
Item_func_sin(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("sin") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sin>(thd, this); }
};
@@ -1939,13 +1945,13 @@ class Item_func_tan :public Item_dec_func
{
public:
Item_func_tan(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("tan") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_tan>(thd, this); }
};
@@ -1953,13 +1959,13 @@ class Item_func_cot :public Item_dec_func
{
public:
Item_func_cot(THD *thd, Item *a): Item_dec_func(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("cot") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_cot>(thd, this); }
};
@@ -1968,8 +1974,8 @@ class Item_func_int_val :public Item_func_hybrid_field_type
{
public:
Item_func_int_val(THD *thd, Item *a): Item_func_hybrid_field_type(thd, a) {}
- bool check_partition_func_processor(void *int_arg) { return FALSE; }
- bool check_vcol_func_processor(void *arg) { return FALSE; }
+ bool check_partition_func_processor(void *int_arg) override { return FALSE; }
+ bool check_vcol_func_processor(void *arg) override { return FALSE; }
virtual decimal_round_mode round_mode() const= 0;
void fix_length_and_dec_double();
void fix_length_and_dec_int_or_decimal();
@@ -1985,9 +1991,9 @@ public:
// Thinks like CEILING(TIMESTAMP'0000-01-01 23:59:59.9') returns NULL
set_maybe_null();
}
- bool fix_length_and_dec();
- String *str_op(String *str) { DBUG_ASSERT(0); return 0; }
- bool native_op(THD *thd, Native *to)
+ bool fix_length_and_dec() override;
+ String *str_op(String *str) override { DBUG_ASSERT(0); return 0; }
+ bool native_op(THD *thd, Native *to) override
{
DBUG_ASSERT(0);
return true;
@@ -2004,13 +2010,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("ceiling") };
return name;
}
- decimal_round_mode round_mode() const { return CEILING; }
- longlong int_op();
- double real_op();
- my_decimal *decimal_op(my_decimal *);
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- Item *get_copy(THD *thd)
+ decimal_round_mode round_mode() const override { return CEILING; }
+ longlong int_op() override;
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ceiling>(thd, this); }
};
@@ -2024,13 +2030,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("floor") };
return name;
}
- decimal_round_mode round_mode() const { return FLOOR; }
- longlong int_op();
- double real_op();
- my_decimal *decimal_op(my_decimal *);
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- Item *get_copy(THD *thd)
+ decimal_round_mode round_mode() const override { return FLOOR; }
+ longlong int_op() override;
+ double real_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_floor>(thd, this); }
};
@@ -2051,17 +2057,17 @@ public:
static LEX_CSTRING round_name= {STRING_WITH_LEN("round") };
return truncate ? truncate_name : round_name;
}
- double real_op();
- longlong int_op();
- my_decimal *decimal_op(my_decimal *);
- bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool time_op(THD *thd, MYSQL_TIME *ltime);
- bool native_op(THD *thd, Native *to)
+ double real_op() override;
+ longlong int_op() override;
+ my_decimal *decimal_op(my_decimal *) override;
+ bool date_op(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool time_op(THD *thd, MYSQL_TIME *ltime) override;
+ bool native_op(THD *thd, Native *to) override
{
DBUG_ASSERT(0);
return true;
}
- String *str_op(String *str)
+ String *str_op(String *str) override
{
DBUG_ASSERT(0);
return NULL;
@@ -2075,7 +2081,7 @@ public:
void fix_arg_time();
void fix_arg_datetime();
void fix_arg_temporal(const Type_handler *h, uint int_part_length);
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
/*
We don't want to translate ENUM/SET to CHAR here.
@@ -2083,7 +2089,7 @@ public:
*/
return args[0]->real_type_handler()->Item_func_round_fix_length_and_dec(this);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_round>(thd, this); }
};
@@ -2092,36 +2098,36 @@ class Item_func_rand :public Item_real_func
{
struct my_rnd_struct *rand;
bool first_eval; // TRUE if val_real() is called 1st time
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_int(0, arg_count); }
void seed_random (Item * val);
public:
Item_func_rand(THD *thd, Item *a):
Item_real_func(thd, a), rand(0), first_eval(TRUE) {}
Item_func_rand(THD *thd): Item_real_func(thd) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("rand") };
return name;
}
- bool const_item() const { return 0; }
- void update_used_tables();
- bool fix_fields(THD *thd, Item **ref);
- void cleanup() { first_eval= TRUE; Item_real_func::cleanup(); }
- bool check_vcol_func_processor(void *arg)
+ bool const_item() const override { return 0; }
+ void update_used_tables() override;
+ bool fix_fields(THD *thd, Item **ref) override;
+ void cleanup() override { first_eval= TRUE; Item_real_func::cleanup(); }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_NON_DETERMINISTIC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rand>(thd, this); }
};
class Item_func_sign :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_real(func_name_cstring()); }
public:
Item_func_sign(THD *thd, Item *a): Item_long_func(thd, a) {}
@@ -2131,9 +2137,9 @@ public:
return name;
}
decimal_digits_t decimal_precision() const override { return 1; }
- bool fix_length_and_dec() { fix_char_length(2); return FALSE; }
- longlong val_int();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override { fix_char_length(2); return FALSE; }
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sign>(thd, this); }
};
@@ -2142,7 +2148,7 @@ class Item_func_units :public Item_real_func
{
LEX_CSTRING name;
double mul,add;
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_real(0, arg_count); }
public:
Item_func_units(THD *thd, char *name_arg, Item *a, double mul_arg,
@@ -2152,15 +2158,15 @@ public:
name.str= name_arg;
name.length= strlen(name_arg);
}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override { return name; }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= NOT_FIXED_DEC;
max_length= float_length(decimals);
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_units>(thd, this); }
};
@@ -2181,7 +2187,7 @@ class Item_func_min_max :public Item_hybrid_func
String tmp_value;
int cmp_sign;
protected:
- bool check_arguments() const
+ bool check_arguments() const override
{
return false; // Checked by aggregate_for_min_max()
}
@@ -2197,37 +2203,37 @@ public:
bool get_date_native(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
bool get_time_native(THD *thd, MYSQL_TIME *res);
- double val_real()
+ double val_real() override
{
DBUG_ASSERT(fixed());
return Item_func_min_max::type_handler()->
Item_func_min_max_val_real(this);
}
- longlong val_int()
+ longlong val_int() override
{
DBUG_ASSERT(fixed());
return Item_func_min_max::type_handler()->
Item_func_min_max_val_int(this);
}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
DBUG_ASSERT(fixed());
return Item_func_min_max::type_handler()->
Item_func_min_max_val_str(this, str);
}
- my_decimal *val_decimal(my_decimal *dec)
+ my_decimal *val_decimal(my_decimal *dec) override
{
DBUG_ASSERT(fixed());
return Item_func_min_max::type_handler()->
Item_func_min_max_val_decimal(this, dec);
}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override
{
DBUG_ASSERT(fixed());
return Item_func_min_max::type_handler()->
Item_func_min_max_get_date(thd, this, res, fuzzydate);
}
- bool val_native(THD *thd, Native *to);
+ bool val_native(THD *thd, Native *to) override;
void aggregate_attributes_real(Item **items, uint nitems)
{
/*
@@ -2248,7 +2254,7 @@ public:
Item_func::aggregate_attributes_real(items, nitems);
max_length= float_length(decimals);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (aggregate_for_min_max(func_name_cstring(), args, arg_count))
return true;
@@ -2266,7 +2272,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("least") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_min>(thd, this); }
};
@@ -2279,7 +2285,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("greatest") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_max>(thd, this); }
};
@@ -2296,39 +2302,41 @@ public:
{
name= a->name;
}
- double val_real() { return val_real_from_item(args[0]); }
- longlong val_int() { return val_int_from_item(args[0]); }
- String *val_str(String *str) { return val_str_from_item(args[0], str); }
- bool val_native(THD *thd, Native *to)
- { return val_native_from_item(thd, args[0], to); }
- my_decimal *val_decimal(my_decimal *dec)
+ double val_real() override { return val_real_from_item(args[0]); }
+ longlong val_int() override { return val_int_from_item(args[0]); }
+ String *val_str(String *str) override
+ { return val_str_from_item(args[0], str); }
+ bool val_native(THD *thd, Native *to) override
+ { return val_native_from_item(thd, args[0], to); }
+ my_decimal *val_decimal(my_decimal *dec) override
{ return val_decimal_from_item(args[0], dec); }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{ return get_date_from_item(thd, args[0], ltime, fuzzydate); }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("rollup_const") };
return name;
}
- bool const_item() const { return 0; }
- const Type_handler *type_handler() const { return args[0]->type_handler(); }
- bool fix_length_and_dec()
+ bool const_item() const override { return 0; }
+ const Type_handler *type_handler() const override
+ { return args[0]->type_handler(); }
+ bool fix_length_and_dec() override
{
Type_std_attributes::set(*args[0]);
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rollup_const>(thd, this); }
};
class Item_long_func_length: public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_str(func_name_cstring()); }
public:
Item_long_func_length(THD *thd, Item *a): Item_long_func(thd, a) {}
- bool fix_length_and_dec() { max_length=10; return FALSE; }
+ bool fix_length_and_dec() override { max_length=10; return FALSE; }
};
@@ -2337,13 +2345,13 @@ class Item_func_octet_length :public Item_long_func_length
String value;
public:
Item_func_octet_length(THD *thd, Item *a): Item_long_func_length(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("octet_length") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_octet_length>(thd, this); }
};
@@ -2352,18 +2360,18 @@ class Item_func_bit_length :public Item_longlong_func
String value;
public:
Item_func_bit_length(THD *thd, Item *a): Item_longlong_func(thd, a) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= 11; // 0x100000000*8 = 34,359,738,368
return FALSE;
}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("bit_length") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_bit_length>(thd, this); }
};
@@ -2372,47 +2380,48 @@ class Item_func_char_length :public Item_long_func_length
String value;
public:
Item_func_char_length(THD *thd, Item *a): Item_long_func_length(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("char_length") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_char_length>(thd, this); }
};
class Item_func_coercibility :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_str(func_name_cstring()); }
public:
Item_func_coercibility(THD *thd, Item *a): Item_long_func(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("coercibility") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length=10;
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
}
- bool eval_not_null_tables(void *)
+ bool eval_not_null_tables(void *) override
{
not_null_tables_cache= 0;
return false;
}
- bool find_not_null_fields(table_map allowed)
+ bool find_not_null_fields(table_map allowed) override
{
return false;
}
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{ return this; }
- bool const_item() const { return true; }
- Item *get_copy(THD *thd)
+ bool const_item() const override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_coercibility>(thd, this); }
};
@@ -2425,7 +2434,7 @@ public:
*/
class Item_func_locate :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return check_argument_types_can_return_str(0, 2) ||
(arg_count > 2 && args[2]->check_type_can_return_int(func_name_cstring()));
@@ -2442,14 +2451,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("locate") };
return name;
}
- longlong val_int();
- bool fix_length_and_dec()
+ longlong val_int() override;
+ bool fix_length_and_dec() override
{
max_length= MY_INT32_NUM_DECIMAL_DIGITS;
return agg_arg_charsets_for_comparison(cmp_collation, args, 2);
}
- virtual void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_locate>(thd, this); }
};
@@ -2461,57 +2470,57 @@ class Item_func_field :public Item_long_func
DTCollation cmp_collation;
public:
Item_func_field(THD *thd, List<Item> &list): Item_long_func(thd, list) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("field") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_field>(thd, this); }
};
class Item_func_ascii :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_str(0, arg_count); }
String value;
public:
Item_func_ascii(THD *thd, Item *a): Item_long_func(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("ascii") };
return name;
}
- bool fix_length_and_dec() { max_length=3; return FALSE; }
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override { max_length=3; return FALSE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ascii>(thd, this); }
};
class Item_func_ord :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_str(func_name_cstring()); }
String value;
public:
Item_func_ord(THD *thd, Item *a): Item_long_func(thd, a) {}
- bool fix_length_and_dec() { fix_char_length(7); return FALSE; }
- longlong val_int();
+ bool fix_length_and_dec() override { fix_char_length(7); return FALSE; }
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("ord") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ord>(thd, this); }
};
class Item_func_find_in_set :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_str(0, 2); }
String value,value2;
uint enum_value;
@@ -2520,14 +2529,14 @@ class Item_func_find_in_set :public Item_long_func
public:
Item_func_find_in_set(THD *thd, Item *a, Item *b):
Item_long_func(thd, a, b), enum_value(0) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("find_in_set") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_find_in_set>(thd, this); }
};
@@ -2535,7 +2544,7 @@ public:
class Item_func_bit_operator: public Item_handled_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_int(0, arg_count); }
protected:
bool fix_length_and_dec_op1_std(const Handler *ha_int, const Handler *ha_dec)
@@ -2554,11 +2563,11 @@ public:
:Item_handled_func(thd, a) {}
Item_func_bit_operator(THD *thd, Item *a, Item *b)
:Item_handled_func(thd, a, b) {}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
print_op(str, query_type);
}
- bool need_parentheses_in_default() { return true; }
+ bool need_parentheses_in_default() override { return true; }
};
class Item_func_bit_or :public Item_func_bit_operator
@@ -2566,14 +2575,14 @@ class Item_func_bit_or :public Item_func_bit_operator
public:
Item_func_bit_or(THD *thd, Item *a, Item *b)
:Item_func_bit_operator(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("|") };
return name;
}
- enum precedence precedence() const { return BITOR_PRECEDENCE; }
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return BITOR_PRECEDENCE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_bit_or>(thd, this); }
};
@@ -2582,20 +2591,20 @@ class Item_func_bit_and :public Item_func_bit_operator
public:
Item_func_bit_and(THD *thd, Item *a, Item *b)
:Item_func_bit_operator(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("&") };
return name;
}
- enum precedence precedence() const { return BITAND_PRECEDENCE; }
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return BITAND_PRECEDENCE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_bit_and>(thd, this); }
};
class Item_func_bit_count :public Item_handled_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_int(func_name_cstring()); }
public:
Item_func_bit_count(THD *thd, Item *a): Item_handled_func(thd, a) {}
@@ -2604,8 +2613,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("bit_count") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_bit_count>(thd, this); }
};
@@ -2614,14 +2623,14 @@ class Item_func_shift_left :public Item_func_bit_operator
public:
Item_func_shift_left(THD *thd, Item *a, Item *b)
:Item_func_bit_operator(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<<") };
return name;
}
- enum precedence precedence() const { return SHIFT_PRECEDENCE; }
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return SHIFT_PRECEDENCE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_shift_left>(thd, this); }
};
@@ -2630,14 +2639,14 @@ class Item_func_shift_right :public Item_func_bit_operator
public:
Item_func_shift_right(THD *thd, Item *a, Item *b)
:Item_func_bit_operator(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN(">>") };
return name;
}
- enum precedence precedence() const { return SHIFT_PRECEDENCE; }
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return SHIFT_PRECEDENCE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_shift_right>(thd, this); }
};
@@ -2645,56 +2654,56 @@ class Item_func_bit_neg :public Item_func_bit_operator
{
public:
Item_func_bit_neg(THD *thd, Item *a): Item_func_bit_operator(thd, a) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("~") };
return name;
}
- enum precedence precedence() const { return NEG_PRECEDENCE; }
- void print(String *str, enum_query_type query_type)
+ enum precedence precedence() const override { return NEG_PRECEDENCE; }
+ void print(String *str, enum_query_type query_type) override
{
str->append(func_name_cstring());
args[0]->print_parenthesised(str, query_type, precedence());
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_bit_neg>(thd, this); }
};
class Item_func_last_insert_id :public Item_longlong_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_int(0, arg_count); }
public:
Item_func_last_insert_id(THD *thd): Item_longlong_func(thd) {}
Item_func_last_insert_id(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("last_insert_id") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
unsigned_flag= true;
if (arg_count)
max_length= args[0]->max_length;
return FALSE;
}
- bool fix_fields(THD *thd, Item **ref);
- bool check_vcol_func_processor(void *arg)
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_last_insert_id>(thd, this); }
};
class Item_func_benchmark :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_int(func_name_cstring()) ||
args[1]->check_type_scalar(func_name_cstring());
@@ -2703,24 +2712,24 @@ public:
Item_func_benchmark(THD *thd, Item *count_expr, Item *expr):
Item_long_func(thd, count_expr, expr)
{}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("benchmark") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length=1;
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
}
- virtual void print(String *str, enum_query_type query_type);
- bool check_vcol_func_processor(void *arg)
+ void print(String *str, enum_query_type query_type) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_benchmark>(thd, this); }
};
@@ -2730,28 +2739,28 @@ void item_func_sleep_free(void);
class Item_func_sleep :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_real(func_name_cstring()); }
public:
Item_func_sleep(THD *thd, Item *a): Item_long_func(thd, a) {}
- bool fix_length_and_dec() { fix_char_length(1); return FALSE; }
- bool const_item() const { return 0; }
+ bool fix_length_and_dec() override { fix_char_length(1); return FALSE; }
+ bool const_item() const override { return 0; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("sleep") };
return name;
}
- table_map used_tables() const
+ table_map used_tables() const override
{
return used_tables_cache | RAND_TABLE_BIT;
}
- bool is_expensive() { return 1; }
- longlong val_int();
- bool check_vcol_func_processor(void *arg)
+ bool is_expensive() override { return 1; }
+ longlong val_int() override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sleep>(thd, this); }
};
@@ -2772,7 +2781,7 @@ class Item_udf_func :public Item_func
}
protected:
udf_handler udf;
- bool is_expensive_processor(void *arg) { return TRUE; }
+ bool is_expensive_processor(void *arg) override { return TRUE; }
class VDec_udf: public Dec_ptr_and_buffer
{
@@ -2796,8 +2805,8 @@ public:
const char *tmp= udf.name();
return { tmp, strlen(tmp) };
}
- enum Functype functype() const { return UDF_FUNC; }
- bool fix_fields(THD *thd, Item **ref)
+ enum Functype functype() const override { return UDF_FUNC; }
+ bool fix_fields(THD *thd, Item **ref) override
{
DBUG_ASSERT(fixed() == 0);
bool res= udf.fix_fields(thd, this, arg_count, args);
@@ -2806,7 +2815,7 @@ public:
return res;
}
void fix_num_length_and_dec();
- void update_used_tables()
+ void update_used_tables() override
{
/*
TODO: Make a member in UDF_INIT and return if a UDF is deterministic or
@@ -2855,28 +2864,28 @@ public:
set_non_deterministic_if_needed();
}
}
- void cleanup();
- bool eval_not_null_tables(void *opt_arg)
+ void cleanup() override;
+ bool eval_not_null_tables(void *opt_arg) override
{
not_null_tables_cache= 0;
return 0;
}
- bool find_not_null_fields(table_map allowed)
+ bool find_not_null_fields(table_map allowed) override
{
return false;
}
- bool is_expensive() { return 1; }
- virtual void print(String *str, enum_query_type query_type);
- bool check_vcol_func_processor(void *arg)
+ bool is_expensive() override { return 1; }
+ void print(String *str, enum_query_type query_type) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_NON_DETERMINISTIC);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
- bool excl_dep_on_grouping_fields(st_select_lex *sel)
+ bool excl_dep_on_grouping_fields(st_select_lex *sel) override
{ return false; }
};
@@ -2889,13 +2898,13 @@ class Item_func_udf_float :public Item_udf_func
Item_func_udf_float(THD *thd, udf_func *udf_arg,
List<Item> &list):
Item_udf_func(thd, udf_arg, list) {}
- longlong val_int()
+ longlong val_int() override
{
DBUG_ASSERT(fixed());
return Converter_double_to_longlong(Item_func_udf_float::val_real(),
unsigned_flag).result();
}
- my_decimal *val_decimal(my_decimal *dec_buf)
+ my_decimal *val_decimal(my_decimal *dec_buf) override
{
double res=val_real();
if (null_value)
@@ -2903,11 +2912,12 @@ class Item_func_udf_float :public Item_udf_func
double2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
return dec_buf;
}
- double val_real();
- String *val_str(String *str);
- const Type_handler *type_handler() const { return &type_handler_double; }
- bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; }
- Item *get_copy(THD *thd)
+ double val_real() override;
+ String *val_str(String *str) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ bool fix_length_and_dec() override { fix_num_length_and_dec(); return FALSE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_udf_float>(thd, this); }
};
@@ -2920,21 +2930,21 @@ public:
Item_func_udf_int(THD *thd, udf_func *udf_arg,
List<Item> &list):
Item_udf_func(thd, udf_arg, list) {}
- longlong val_int();
- double val_real() { return (double) Item_func_udf_int::val_int(); }
- my_decimal *val_decimal(my_decimal *decimal_value)
+ longlong val_int() override;
+ double val_real() override { return (double) Item_func_udf_int::val_int(); }
+ my_decimal *val_decimal(my_decimal *decimal_value) override
{
return val_decimal_from_int(decimal_value);
}
- String *val_str(String *str);
- const Type_handler *type_handler() const
+ String *val_str(String *str) override;
+ const Type_handler *type_handler() const override
{
if (unsigned_flag)
return &type_handler_ulonglong;
return &type_handler_slonglong;
}
- bool fix_length_and_dec() { decimals= 0; max_length= 21; return FALSE; }
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override { decimals= 0; max_length= 21; return FALSE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_udf_int>(thd, this); }
};
@@ -2946,22 +2956,23 @@ public:
Item_udf_func(thd, udf_arg) {}
Item_func_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
Item_udf_func(thd, udf_arg, list) {}
- longlong val_int()
+ longlong val_int() override
{
return VDec_udf(this, &udf).to_longlong(unsigned_flag);
}
- double val_real()
+ double val_real() override
{
return VDec_udf(this, &udf).to_double();
}
- my_decimal *val_decimal(my_decimal *);
- String *val_str(String *str)
+ my_decimal *val_decimal(my_decimal *) override;
+ String *val_str(String *str) override
{
return VDec_udf(this, &udf).to_string_round(str, decimals);
}
- const Type_handler *type_handler() const { return &type_handler_newdecimal; }
- bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; }
- Item *get_copy(THD *thd)
+ const Type_handler *type_handler() const override
+ { return &type_handler_newdecimal; }
+ bool fix_length_and_dec() override { fix_num_length_and_dec(); return FALSE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_udf_decimal>(thd, this); }
};
@@ -2973,8 +2984,8 @@ public:
Item_udf_func(thd, udf_arg) {}
Item_func_udf_str(THD *thd, udf_func *udf_arg, List<Item> &list):
Item_udf_func(thd, udf_arg, list) {}
- String *val_str(String *);
- double val_real()
+ String *val_str(String *) override;
+ double val_real() override
{
int err_not_used;
char *end_not_used;
@@ -2983,14 +2994,14 @@ public:
return res ? res->charset()->strntod((char*) res->ptr(), res->length(),
&end_not_used, &err_not_used) : 0.0;
}
- longlong val_int()
+ longlong val_int() override
{
int err_not_used;
String *res; res=val_str(&str_value);
return res ? res->charset()->strntoll(res->ptr(),res->length(),10,
(char**) 0, &err_not_used) : (longlong) 0;
}
- my_decimal *val_decimal(my_decimal *dec_buf)
+ my_decimal *val_decimal(my_decimal *dec_buf) override
{
String *res=val_str(&str_value);
if (!res)
@@ -2998,9 +3009,10 @@ public:
string2my_decimal(E_DEC_FATAL_ERROR, res, dec_buf);
return dec_buf;
}
- const Type_handler *type_handler() const { return string_type_handler(); }
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ const Type_handler *type_handler() const override
+ { return string_type_handler(); }
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_udf_str>(thd, this); }
};
@@ -3024,7 +3036,8 @@ public:
Item_int_func(thd) {}
Item_func_udf_int(THD *thd, udf_func *udf_arg, List<Item> &list):
Item_int_func(thd, list) {}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
longlong val_int() { DBUG_ASSERT(fixed()); return 0; }
};
@@ -3036,7 +3049,8 @@ public:
Item_int_func(thd) {}
Item_func_udf_decimal(THD *thd, udf_func *udf_arg, List<Item> &list):
Item_int_func(thd, list) {}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
my_decimal *val_decimal(my_decimal *) { DBUG_ASSERT(fixed()); return 0; }
};
@@ -3068,13 +3082,13 @@ class Item_func_lock :public Item_long_func
Item_func_lock(THD *thd): Item_long_func(thd) { }
Item_func_lock(THD *thd, Item *a): Item_long_func(thd, a) {}
Item_func_lock(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
- table_map used_tables() const
+ table_map used_tables() const override
{
return used_tables_cache | RAND_TABLE_BIT;
}
- bool const_item() const { return 0; }
- bool is_expensive() { return 1; }
- bool check_vcol_func_processor(void *arg)
+ bool const_item() const override { return 0; }
+ bool is_expensive() override { return 1; }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
@@ -3083,7 +3097,7 @@ class Item_func_lock :public Item_long_func
class Item_func_get_lock final :public Item_func_lock
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
args[1]->check_type_can_return_real(func_name_cstring());
@@ -3097,7 +3111,7 @@ class Item_func_get_lock final :public Item_func_lock
static LEX_CSTRING name= {STRING_WITH_LEN("get_lock") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= 1;
set_maybe_null();
@@ -3126,7 +3140,7 @@ public:
class Item_func_release_lock final :public Item_func_lock
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_general_purpose_string(func_name_cstring()); }
String value;
public:
@@ -3137,7 +3151,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("release_lock") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= 1;
set_maybe_null();
@@ -3152,7 +3166,7 @@ public:
class Item_master_pos_wait :public Item_longlong_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return
args[0]->check_type_general_purpose_string(func_name_cstring()) ||
@@ -3168,30 +3182,30 @@ public:
Item_longlong_func(thd, a, b, c) {}
Item_master_pos_wait(THD *thd, Item *a, Item *b, Item *c, Item *d):
Item_longlong_func(thd, a, b, c, d) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("master_pos_wait") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length=21;
set_maybe_null();
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_master_pos_wait>(thd, this); }
};
class Item_master_gtid_wait :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
(arg_count > 1 && args[1]->check_type_can_return_real(func_name_cstring()));
@@ -3202,18 +3216,18 @@ public:
:Item_long_func(thd, a) {}
Item_master_gtid_wait(THD *thd, Item *a, Item *b)
:Item_long_func(thd, a, b) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("master_gtid_wait") };
return name;
}
- bool fix_length_and_dec() { max_length=2; return FALSE; }
- bool check_vcol_func_processor(void *arg)
+ bool fix_length_and_dec() override { max_length=2; return FALSE; }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_master_gtid_wait>(thd, this); }
};
@@ -3292,28 +3306,28 @@ public:
null_item(item->null_item), save_result(item->save_result)
{}
- enum Functype functype() const { return SUSERVAR_FUNC; }
- double val_real();
- longlong val_int();
- String *val_str(String *str);
- my_decimal *val_decimal(my_decimal *);
- double val_result();
- longlong val_int_result();
- bool val_bool_result();
- String *str_result(String *str);
- my_decimal *val_decimal_result(my_decimal *);
- bool is_null_result();
+ enum Functype functype() const override { return SUSERVAR_FUNC; }
+ double val_real() override;
+ longlong val_int() override;
+ String *val_str(String *str) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ double val_result() override;
+ longlong val_int_result() override;
+ bool val_bool_result() override;
+ String *str_result(String *str) override;
+ my_decimal *val_decimal_result(my_decimal *) override;
+ bool is_null_result() override;
bool update_hash(void *ptr, size_t length, enum Item_result type,
CHARSET_INFO *cs, bool unsigned_arg);
- bool send(Protocol *protocol, st_value *buffer);
- void make_send_field(THD *thd, Send_field *tmp_field);
+ bool send(Protocol *protocol, st_value *buffer) override;
+ void make_send_field(THD *thd, Send_field *tmp_field) override;
bool check(bool use_result_field);
void save_item_result(Item *item);
bool update();
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
- void print(String *str, enum_query_type query_type);
- enum precedence precedence() const { return ASSIGN_PRECEDENCE; }
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
+ void print(String *str, enum_query_type query_type) override;
+ enum precedence precedence() const override { return ASSIGN_PRECEDENCE; }
void print_as_stmt(String *str, enum_query_type query_type);
LEX_CSTRING func_name_cstring() const override
{
@@ -3322,20 +3336,21 @@ public:
}
int save_in_field(Field *field, bool no_conversions,
bool can_use_result_field);
- int save_in_field(Field *field, bool no_conversions)
+ int save_in_field(Field *field, bool no_conversions) override
{
return save_in_field(field, no_conversions, 1);
}
void save_org_in_field(Field *field,
fast_field_copier data __attribute__ ((__unused__)))
- { (void)save_in_field(field, 1, 0); }
- bool register_field_in_read_map(void *arg);
- bool register_field_in_bitmap(void *arg);
+ override
+ { (void) save_in_field(field, 1, 0); }
+ bool register_field_in_read_map(void *arg) override;
+ bool register_field_in_bitmap(void *arg) override;
bool set_entry(THD *thd, bool create_if_not_exists);
- void cleanup();
- Item *get_copy(THD *thd)
+ void cleanup() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_set_user_var>(thd, this); }
- bool excl_dep_on_table(table_map tab_map) { return false; }
+ bool excl_dep_on_table(table_map tab_map) override { return false; }
};
@@ -3345,14 +3360,14 @@ class Item_func_get_user_var :public Item_func_user_var,
public:
Item_func_get_user_var(THD *thd, const LEX_CSTRING *a):
Item_func_user_var(thd, a) {}
- enum Functype functype() const { return GUSERVAR_FUNC; }
+ enum Functype functype() const override { return GUSERVAR_FUNC; }
LEX_CSTRING get_name() { return name; }
- double val_real();
- longlong val_int();
- my_decimal *val_decimal(my_decimal*);
- String *val_str(String* str);
- bool fix_length_and_dec();
- virtual void print(String *str, enum_query_type query_type);
+ double val_real() override;
+ longlong val_int() override;
+ my_decimal *val_decimal(my_decimal*) override;
+ String *val_str(String* str) override;
+ bool fix_length_and_dec() override;
+ void print(String *str, enum_query_type query_type) override;
/*
We must always return variables as strings to guard against selects of type
select @t1:=1,@t1,@t:="hello",@t from foo where (@t1:= t2.b)
@@ -3362,17 +3377,17 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("get_user_var") };
return name;
}
- bool const_item() const;
- table_map used_tables() const
+ bool const_item() const override;
+ table_map used_tables() const override
{ return const_item() ? 0 : RAND_TABLE_BIT; }
- bool eq(const Item *item, bool binary_cmp) const;
- Item *get_copy(THD *thd)
+ bool eq(const Item *item, bool binary_cmp) const override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_get_user_var>(thd, this); }
private:
- bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
+ bool set_value(THD *thd, sp_rcontext *ctx, Item **it) override;
public:
- Settable_routine_parameter *get_settable_routine_parameter()
+ Settable_routine_parameter *get_settable_routine_parameter() override
{
return this;
}
@@ -3401,54 +3416,55 @@ public:
org_name= *a;
set_name(thd, a->str, a->length, system_charset_info);
}
- Load_data_outvar *get_load_data_outvar()
+ Load_data_outvar *get_load_data_outvar() override
{
return this;
}
- bool load_data_set_null(THD *thd, const Load_data_param *param)
+ bool load_data_set_null(THD *thd, const Load_data_param *param) override
{
set_null_value(param->charset());
return false;
}
- bool load_data_set_no_data(THD *thd, const Load_data_param *param)
+ bool load_data_set_no_data(THD *thd, const Load_data_param *param) override
{
set_null_value(param->charset());
return false;
}
bool load_data_set_value(THD *thd, const char *pos, uint length,
- const Load_data_param *param)
+ const Load_data_param *param) override
{
set_value(pos, length, param->charset());
return false;
}
- void load_data_print_for_log_event(THD *thd, String *to) const;
- bool load_data_add_outvar(THD *thd, Load_data_param *param) const
+ void load_data_print_for_log_event(THD *thd, String *to) const override;
+ bool load_data_add_outvar(THD *thd, Load_data_param *param) const override
{
return param->add_outvar_user_var(thd);
}
- uint load_data_fixed_length() const
+ uint load_data_fixed_length() const override
{
return 0;
}
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
DBUG_ASSERT(0);
return NULL;
}
/* We should return something different from FIELD_ITEM here */
- enum Type type() const { return CONST_ITEM;}
- double val_real();
- longlong val_int();
- String *val_str(String *str);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- my_decimal *val_decimal(my_decimal *decimal_buffer);
+ enum Type type() const override { return CONST_ITEM;}
+ double val_real() override;
+ longlong val_int() override;
+ String *val_str(String *str) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ my_decimal *val_decimal(my_decimal *decimal_buffer) override;
/* fix_fields() binds variable name with its entry structure */
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_fields(THD *thd, Item **ref) override;
void set_null_value(CHARSET_INFO* cs);
void set_value(const char *str, uint length, CHARSET_INFO* cs);
- const Type_handler *type_handler() const { return &type_handler_double; }
- Item *get_copy(THD *thd)
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_user_var_as_out_param>(thd, this); }
};
@@ -3476,19 +3492,19 @@ public:
enum_var_type var_type_arg,
LEX_CSTRING *component_arg, const char *name_arg,
size_t name_len_arg);
- enum Functype functype() const { return GSYSVAR_FUNC; }
- void update_null_value();
- bool fix_length_and_dec();
- void print(String *str, enum_query_type query_type);
- bool const_item() const { return true; }
- table_map used_tables() const { return 0; }
- const Type_handler *type_handler() const;
- double val_real();
- longlong val_int();
- String* val_str(String*);
- my_decimal *val_decimal(my_decimal *dec_buf)
+ enum Functype functype() const override { return GSYSVAR_FUNC; }
+ void update_null_value() override;
+ bool fix_length_and_dec() override;
+ void print(String *str, enum_query_type query_type) override;
+ bool const_item() const override { return true; }
+ table_map used_tables() const override { return 0; }
+ const Type_handler *type_handler() const override;
+ double val_real() override;
+ longlong val_int() override;
+ String* val_str(String*) override;
+ my_decimal *val_decimal(my_decimal *dec_buf) override
{ return val_decimal_from_real(dec_buf); }
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
@@ -3507,11 +3523,11 @@ public:
@return true if the variable is written to the binlog, false otherwise.
*/
bool is_written_to_binlog();
- bool eq(const Item *item, bool binary_cmp) const;
+ bool eq(const Item *item, bool binary_cmp) const override;
- void cleanup();
- bool check_vcol_func_processor(void *arg);
- Item *get_copy(THD *thd)
+ void cleanup() override;
+ bool check_vcol_func_processor(void *arg) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_get_system_var>(thd, this); }
};
@@ -3534,7 +3550,7 @@ public:
Item_func_match(THD *thd, List<Item> &a, uint b):
Item_real_func(thd, a), key(0), match_flags(b), join_key(0), ft_handler(0),
table(0), master(0), concat_ws(0) { }
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_match::cleanup");
Item_real_func::cleanup();
@@ -3545,38 +3561,38 @@ public:
table= 0; // required by Item_func_match::eq()
DBUG_VOID_RETURN;
}
- bool is_expensive_processor(void *arg) { return TRUE; }
- enum Functype functype() const { return FT_FUNC; }
+ bool is_expensive_processor(void *arg) override { return TRUE; }
+ enum Functype functype() const override { return FT_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("match") };
return name;
}
- bool eval_not_null_tables(void *opt_arg)
+ bool eval_not_null_tables(void *opt_arg) override
{
not_null_tables_cache= 0;
return 0;
}
- bool find_not_null_fields(table_map allowed)
+ bool find_not_null_fields(table_map allowed) override
{
return false;
}
- bool fix_fields(THD *thd, Item **ref);
- bool eq(const Item *, bool binary_cmp) const;
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool eq(const Item *, bool binary_cmp) const override;
/* The following should be safe, even if we compare doubles */
- longlong val_int() { DBUG_ASSERT(fixed()); return val_real() != 0.0; }
- double val_real();
+ longlong val_int() override { DBUG_ASSERT(fixed()); return val_real() != 0.0; }
+ double val_real() override;
void print(String *str, enum_query_type query_type) override;
bool fix_index();
bool init_search(THD *thd, bool no_order);
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function("match ... against()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_match>(thd, this); }
- Item *build_clone(THD *thd) { return 0; }
+ Item *build_clone(THD *thd) override { return 0; }
private:
/**
Check whether storage engine for given table,
@@ -3619,69 +3635,69 @@ class Item_func_bit_xor : public Item_func_bit_operator
public:
Item_func_bit_xor(THD *thd, Item *a, Item *b)
:Item_func_bit_operator(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("^") };
return name;
}
- enum precedence precedence() const { return BITXOR_PRECEDENCE; }
- Item *get_copy(THD *thd)
+ enum precedence precedence() const override { return BITXOR_PRECEDENCE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_bit_xor>(thd, this); }
};
class Item_func_is_free_lock :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_general_purpose_string(func_name_cstring()); }
String value;
public:
Item_func_is_free_lock(THD *thd, Item *a): Item_long_func(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("is_free_lock") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=1;
set_maybe_null();
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_is_free_lock>(thd, this); }
};
class Item_func_is_used_lock :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_general_purpose_string(func_name_cstring()); }
String value;
public:
Item_func_is_used_lock(THD *thd, Item *a): Item_long_func(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("is_used_lock") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0; max_length=10;
set_maybe_null();
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_is_used_lock>(thd, this); }
};
@@ -3726,23 +3742,23 @@ class Item_func_row_count :public Item_longlong_func
{
public:
Item_func_row_count(THD *thd): Item_longlong_func(thd) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("row_count") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= 0;
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_row_count>(thd, this); }
};
@@ -3762,10 +3778,10 @@ private:
bool execute();
protected:
- bool is_expensive_processor(void *arg)
+ bool is_expensive_processor(void *arg) override
{ return is_expensive(); }
- bool check_arguments() const
+ bool check_arguments() const override
{
// sp_prepare_func_item() checks that the number of columns is correct
return false;
@@ -3781,53 +3797,53 @@ public:
virtual ~Item_func_sp()
{}
- void update_used_tables();
+ void update_used_tables() override;
- void cleanup();
+ void cleanup() override;
LEX_CSTRING func_name_cstring() const override;
- const Type_handler *type_handler() const;
+ const Type_handler *type_handler() const override;
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param);
- Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
+ const Tmp_field_param *param) override;
+ Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
{
return result_type() != STRING_RESULT ?
sp_result_field :
create_table_field_from_handler(root, table);
}
- void make_send_field(THD *thd, Send_field *tmp_field);
+ void make_send_field(THD *thd, Send_field *tmp_field) override;
- longlong val_int()
+ longlong val_int() override
{
if (execute())
return (longlong) 0;
return sp_result_field->val_int();
}
- double val_real()
+ double val_real() override
{
if (execute())
return 0.0;
return sp_result_field->val_real();
}
- my_decimal *val_decimal(my_decimal *dec_buf)
+ my_decimal *val_decimal(my_decimal *dec_buf) override
{
if (execute())
return NULL;
return sp_result_field->val_decimal(dec_buf);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
if (execute())
return true;
return sp_result_field->get_date(ltime, fuzzydate);
}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
String buf;
char buff[20];
@@ -3846,26 +3862,26 @@ public:
return str;
}
- bool val_native(THD *thd, Native *to)
+ bool val_native(THD *thd, Native *to) override
{
if (execute())
return true;
return (null_value= sp_result_field->val_native(to));
}
- void update_null_value()
+ void update_null_value() override
{
execute();
}
- virtual bool change_context_processor(void *cntx)
- { context= (Name_resolution_context *)cntx; return FALSE; }
+ bool change_context_processor(void *cntx) override
+ { context= (Name_resolution_context *)cntx; return FALSE; }
- virtual enum Functype functype() const { return FUNC_SP; }
+ enum Functype functype() const override { return FUNC_SP; }
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec(void);
- bool is_expensive();
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec(void) override;
+ bool is_expensive() override;
inline Field *get_sp_result_field()
{
@@ -3876,20 +3892,20 @@ public:
return m_name;
}
- bool check_vcol_func_processor(void *arg);
- bool limit_index_condition_pushdown_processor(void *opt_arg)
+ bool check_vcol_func_processor(void *arg) override;
+ bool limit_index_condition_pushdown_processor(void *opt_arg) override
{
return TRUE;
}
- Item *get_copy(THD *) { return 0; }
- bool eval_not_null_tables(void *opt_arg)
+ Item *get_copy(THD *) override { return 0; }
+ bool eval_not_null_tables(void *opt_arg) override
{
not_null_tables_cache= 0;
return 0;
}
- bool excl_dep_on_grouping_fields(st_select_lex *sel)
+ bool excl_dep_on_grouping_fields(st_select_lex *sel) override
{ return false; }
- bool find_not_null_fields(table_map allowed)
+ bool find_not_null_fields(table_map allowed) override
{
return false;
}
@@ -3900,23 +3916,23 @@ class Item_func_found_rows :public Item_longlong_func
{
public:
Item_func_found_rows(THD *thd): Item_longlong_func(thd) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("found_rows") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= 0;
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_found_rows>(thd, this); }
};
@@ -3925,21 +3941,21 @@ class Item_func_oracle_sql_rowcount :public Item_longlong_func
{
public:
Item_func_oracle_sql_rowcount(THD *thd): Item_longlong_func(thd) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("SQL%ROWCOUNT") };
return name;
}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
str->append(func_name_cstring());
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_oracle_sql_rowcount>(thd, this); }
};
@@ -3948,28 +3964,28 @@ class Item_func_sqlcode: public Item_long_func
{
public:
Item_func_sqlcode(THD *thd): Item_long_func(thd) { }
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("SQLCODE") };
return name;
}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
str->append(func_name_cstring());
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
base_flags&= ~item_base_t::MAYBE_NULL;
null_value= false;
max_length= 11;
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sqlcode>(thd, this); }
};
@@ -3985,17 +4001,17 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("uuid_short") };
return name;
}
- longlong val_int();
- bool const_item() const { return false; }
- bool fix_length_and_dec()
+ longlong val_int() override;
+ bool const_item() const override { return false; }
+ bool fix_length_and_dec() override
{ max_length= 21; unsigned_flag=1; return FALSE; }
- table_map used_tables() const { return RAND_TABLE_BIT; }
- bool check_vcol_func_processor(void *arg)
+ table_map used_tables() const override { return RAND_TABLE_BIT; }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_NON_DETERMINISTIC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_uuid_short>(thd, this); }
};
@@ -4006,36 +4022,37 @@ protected:
Item *last_value;
public:
Item_func_last_value(THD *thd, List<Item> &list): Item_func(thd, list) {}
- double val_real();
- longlong val_int();
- String *val_str(String *);
- my_decimal *val_decimal(my_decimal *);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool val_native(THD *thd, Native *);
- bool fix_length_and_dec();
+ double val_real() override;
+ longlong val_int() override;
+ String *val_str(String *) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool val_native(THD *thd, Native *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("last_value") };
return name;
}
- const Type_handler *type_handler() const { return last_value->type_handler(); }
- bool eval_not_null_tables(void *)
+ const Type_handler *type_handler() const override
+ { return last_value->type_handler(); }
+ bool eval_not_null_tables(void *) override
{
not_null_tables_cache= 0;
return 0;
}
- bool find_not_null_fields(table_map allowed)
+ bool find_not_null_fields(table_map allowed) override
{
return false;
}
- bool const_item() const { return 0; }
+ bool const_item() const override { return 0; }
void evaluate_sideeffects();
- void update_used_tables()
+ void update_used_tables() override
{
Item_func::update_used_tables();
copy_flags(last_value, item_base_t::MAYBE_NULL);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_last_value>(thd, this); }
};
@@ -4050,13 +4067,13 @@ protected:
public:
Item_func_nextval(THD *thd, TABLE_LIST *table_list_arg):
Item_longlong_func(thd), table_list(table_list_arg) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("nextval") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
unsigned_flag= 0;
max_length= MAX_BIGINT_WIDTH;
@@ -4079,11 +4096,11 @@ public:
table= table_list->next_local->table;
}
}
- bool const_item() const { return 0; }
- Item *get_copy(THD *thd)
+ bool const_item() const override { return 0; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_nextval>(thd, this); }
- void print(String *str, enum_query_type query_type);
- bool check_vcol_func_processor(void *arg)
+ void print(String *str, enum_query_type query_type) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
(VCOL_NON_DETERMINISTIC |
@@ -4099,13 +4116,13 @@ class Item_func_lastval :public Item_func_nextval
public:
Item_func_lastval(THD *thd, TABLE_LIST *table_list_arg):
Item_func_nextval(thd, table_list_arg) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("lastval") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_lastval>(thd, this); }
};
@@ -4123,14 +4140,14 @@ public:
: Item_func_nextval(thd, table_list_arg),
nextval(nextval_arg), round(round_arg), is_used(is_used_arg)
{}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("setval") };
return name;
}
- void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_setval>(thd, this); }
};
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 3166a22c136..e7f465170ab 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -42,8 +42,9 @@ public:
Item_geometry_func(THD *thd, Item *a, Item *b, Item *c):
Item_str_func(thd, a, b, c) {}
Item_geometry_func(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
- bool fix_length_and_dec();
- const Type_handler *type_handler() const { return &type_handler_geometry; }
+ bool fix_length_and_dec() override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_geometry; }
};
@@ -54,7 +55,7 @@ class Item_real_func_args_geometry: public Item_real_func
{
protected:
String value;
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count == 1);
return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
@@ -71,7 +72,7 @@ public:
*/
class Item_long_func_args_geometry: public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count == 1);
return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
@@ -92,7 +93,7 @@ class Item_bool_func_args_geometry: public Item_bool_func
{
protected:
String value;
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count == 1);
return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
@@ -110,7 +111,7 @@ public:
class Item_str_ascii_func_args_geometry: public Item_str_ascii_func
{
protected:
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 1);
return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
@@ -132,7 +133,7 @@ public:
class Item_binary_func_args_geometry: public Item_str_func
{
protected:
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 1);
return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
@@ -150,7 +151,7 @@ public:
class Item_geometry_func_args_geometry: public Item_geometry_func
{
protected:
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 1);
return Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(),
@@ -170,7 +171,7 @@ public:
class Item_real_func_args_geometry_geometry: public Item_real_func
{
protected:
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 2);
return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
@@ -189,7 +190,7 @@ class Item_bool_func_args_geometry_geometry: public Item_bool_func
{
protected:
String value;
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 2);
return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
@@ -203,7 +204,7 @@ public:
class Item_func_geometry_from_text: public Item_geometry_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
check_argument_types_can_return_int(1, MY_MIN(2, arg_count));
@@ -217,14 +218,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_geometryfromtext") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_geometry_from_text>(thd, this); }
};
class Item_func_geometry_from_wkb: public Item_geometry_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return
Type_handler_geometry::check_type_geom_or_binary(func_name_cstring(), args[0]) ||
@@ -239,8 +240,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_geometryfromwkb") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_geometry_from_wkb>(thd, this); }
};
@@ -248,7 +249,7 @@ public:
class Item_func_geometry_from_json: public Item_geometry_func
{
String tmp_js;
- bool check_arguments() const
+ bool check_arguments() const override
{
// TODO: check with Alexey, for better args[1] and args[2] type control
return args[0]->check_type_general_purpose_string(func_name_cstring()) ||
@@ -265,8 +266,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_geomfromgeojson") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_geometry_from_json>(thd, this); }
};
@@ -281,9 +282,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_astext") };
return name;
}
- String *val_str_ascii(String *);
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_as_wkt>(thd, this); }
};
@@ -297,9 +298,10 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_aswkb") };
return name;
}
- String *val_str(String *);
- const Type_handler *type_handler() const { return &type_handler_long_blob; }
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_long_blob; }
+ bool fix_length_and_dec() override
{
collation.set(&my_charset_bin);
decimals=0;
@@ -307,14 +309,14 @@ public:
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_as_wkb>(thd, this); }
};
class Item_func_as_geojson: public Item_str_ascii_func_args_geometry
{
- bool check_arguments() const
+ bool check_arguments() const override
{
// TODO: check with Alexey, for better args[1] and args[2] type control
return Item_str_ascii_func_args_geometry::check_arguments() ||
@@ -332,9 +334,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_asgeojson") };
return name;
}
- bool fix_length_and_dec();
- String *val_str_ascii(String *);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ String *val_str_ascii(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_as_geojson>(thd, this); }
};
@@ -344,20 +346,20 @@ class Item_func_geometry_type: public Item_str_ascii_func_args_geometry
public:
Item_func_geometry_type(THD *thd, Item *a)
:Item_str_ascii_func_args_geometry(thd, a) {}
- String *val_str_ascii(String *);
+ String *val_str_ascii(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_geometrytype") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
// "GeometryCollection" is the longest
fix_length_and_charset(20, default_charset());
set_maybe_null();
return FALSE;
};
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_geometry_type>(thd, this); }
};
@@ -395,8 +397,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_convexhull") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_convexhull>(thd, this); }
};
@@ -411,12 +413,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_centroid") };
return name;
}
- String *val_str(String *);
- const Type_handler *type_handler() const
+ String *val_str(String *) override;
+ const Type_handler *type_handler() const override
{
return &type_handler_point;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_centroid>(thd, this); }
};
@@ -430,12 +432,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_envelope") };
return name;
}
- String *val_str(String *);
- const Type_handler *type_handler() const
+ String *val_str(String *) override;
+ const Type_handler *type_handler() const override
{
return &type_handler_polygon;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_envelope>(thd, this); }
};
@@ -472,15 +474,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_boundary") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_boundary>(thd, this); }
};
class Item_func_point: public Item_geometry_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_real(0, 2); }
public:
Item_func_point(THD *thd, Item *a, Item *b): Item_geometry_func(thd, a, b) {}
@@ -491,12 +493,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("point") };
return name;
}
- String *val_str(String *);
- const Type_handler *type_handler() const
+ String *val_str(String *) override;
+ const Type_handler *type_handler() const override
{
return &type_handler_point;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_point>(thd, this); }
};
@@ -524,15 +526,15 @@ public:
return unknown;
}
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_spatial_decomp>(thd, this); }
};
class Item_func_spatial_decomp_n: public Item_geometry_func_args_geometry
{
enum Functype decomp_func_n;
- bool check_arguments() const
+ bool check_arguments() const override
{
return Item_geometry_func_args_geometry::check_arguments() ||
args[1]->check_type_can_return_int(func_name_cstring());
@@ -561,14 +563,14 @@ public:
return unknown;
}
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_spatial_decomp_n>(thd, this); }
};
class Item_func_spatial_collection: public Item_geometry_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(), args,
0, arg_count);
@@ -583,8 +585,8 @@ public:
coll_type=ct;
item_type=it;
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
if (Item_geometry_func::fix_length_and_dec())
return TRUE;
@@ -613,7 +615,7 @@ public:
Geometry::wkb_geometrycollection,
Geometry::wkb_point)
{ }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return &type_handler_geometrycollection;
}
@@ -622,7 +624,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("geometrycollection") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_geometrycollection>(thd, this); }
};
@@ -635,13 +637,14 @@ public:
Geometry::wkb_linestring,
Geometry::wkb_point)
{ }
- const Type_handler *type_handler() const { return &type_handler_linestring; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_linestring; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("linestring") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_linestring>(thd, this); }
};
@@ -654,13 +657,14 @@ public:
Geometry::wkb_polygon,
Geometry::wkb_linestring)
{ }
- const Type_handler *type_handler() const { return &type_handler_polygon; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_polygon; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("polygon") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_polygon>(thd, this); }
};
@@ -673,7 +677,7 @@ public:
Geometry::wkb_multilinestring,
Geometry::wkb_linestring)
{ }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return &type_handler_multilinestring;
}
@@ -682,7 +686,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("multilinestring") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_multilinestring>(thd, this); }
};
@@ -695,7 +699,7 @@ public:
Geometry::wkb_multipoint,
Geometry::wkb_point)
{ }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return &type_handler_multipoint;
}
@@ -704,7 +708,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("multipoint") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_multipoint>(thd, this); }
};
@@ -717,7 +721,7 @@ public:
Geometry::wkb_multipolygon,
Geometry::wkb_polygon)
{ }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return &type_handler_multipolygon;
}
@@ -726,7 +730,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("multipolygon") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_multipolygon>(thd, this); }
};
@@ -743,8 +747,8 @@ protected:
String tmp_value1, tmp_value2;
SEL_ARG *get_mm_leaf(RANGE_OPT_PARAM *param, Field *field,
KEY_PART *key_part,
- Item_func::Functype type, Item *value);
- bool check_arguments() const
+ Item_func::Functype type, Item *value) override;
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 2);
return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
@@ -756,8 +760,8 @@ public:
{
set_maybe_null();
}
- enum Functype functype() const { return spatial_rel; }
- enum Functype rev_functype() const
+ enum Functype functype() const override { return spatial_rel; }
+ enum Functype rev_functype() const override
{
switch (spatial_rel)
{
@@ -769,16 +773,16 @@ public:
return spatial_rel;
}
}
- bool is_null() { (void) val_int(); return null_value; }
+ bool is_null() override { (void) val_int(); return null_value; }
void add_key_fields(JOIN *join, KEY_FIELD **key_fields,
uint *and_level, table_map usable_tables,
- SARGABLE_PARAM **sargables)
+ SARGABLE_PARAM **sargables) override
{
return add_key_fields_optimize_op(join, key_fields, and_level,
usable_tables, sargables, false);
}
- bool need_parentheses_in_default() { return false; }
- Item *build_clone(THD *thd) { return 0; }
+ bool need_parentheses_in_default() override { return false; }
+ Item *build_clone(THD *thd) override { return 0; }
};
@@ -788,9 +792,9 @@ public:
Item_func_spatial_mbr_rel(THD *thd, Item *a, Item *b, enum Functype sp_rel):
Item_func_spatial_rel(thd, a, b, sp_rel)
{ }
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override;
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_spatial_mbr_rel>(thd, this); }
};
@@ -804,9 +808,9 @@ public:
Item_func_spatial_precise_rel(THD *thd, Item *a, Item *b, enum Functype sp_rel):
Item_func_spatial_rel(thd, a, b, sp_rel), collector()
{ }
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override;
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_spatial_precise_rel>(thd, this); }
};
@@ -817,7 +821,7 @@ class Item_func_spatial_relate: public Item_bool_func_args_geometry_geometry
Gcalc_scan_iterator scan_it;
Gcalc_function func;
String tmp_value1, tmp_value2, tmp_matrix;
- bool check_arguments() const
+ bool check_arguments() const override
{
return Item_bool_func_args_geometry_geometry::check_arguments() ||
args[2]->check_type_general_purpose_string(func_name_cstring());
@@ -826,14 +830,14 @@ public:
Item_func_spatial_relate(THD *thd, Item *a, Item *b, Item *matrix):
Item_bool_func_args_geometry_geometry(thd, a, b, matrix)
{ }
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_relate") };
return name;
}
- bool need_parentheses_in_default() { return false; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return false; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_spatial_relate>(thd, this); }
};
@@ -842,9 +846,9 @@ public:
Spatial operations
*/
-class Item_func_spatial_operation: public Item_geometry_func
+class Item_func_spatial_operation final: public Item_geometry_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
DBUG_ASSERT(arg_count >= 2);
return Type_handler_geometry::check_types_geom_or_binary(func_name_cstring(),
@@ -864,20 +868,20 @@ public:
Item_geometry_func(thd, a, b), spatial_op(sp_op)
{}
virtual ~Item_func_spatial_operation();
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override;
- virtual inline void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
Item_func::print(str, query_type);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_spatial_operation>(thd, this); }
};
-class Item_func_buffer: public Item_geometry_func_args_geometry
+class Item_func_buffer final : public Item_geometry_func_args_geometry
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return Item_geometry_func_args_geometry::check_arguments() ||
args[1]->check_type_can_return_real(func_name_cstring());
@@ -930,8 +934,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_buffer") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_buffer>(thd, this); }
};
@@ -963,15 +967,15 @@ class Item_func_issimple: public Item_long_func_args_geometry
public:
Item_func_issimple(THD *thd, Item *a)
:Item_long_func_args_geometry(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_issimple") };
return name;
}
- bool fix_length_and_dec() { decimals=0; max_length=2; return FALSE; }
+ bool fix_length_and_dec() override { decimals=0; max_length=2; return FALSE; }
decimal_digits_t decimal_precision() const override { return 1; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_issimple>(thd, this); }
};
@@ -980,15 +984,15 @@ class Item_func_isclosed: public Item_long_func_args_geometry
public:
Item_func_isclosed(THD *thd, Item *a)
:Item_long_func_args_geometry(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_isclosed") };
return name;
}
- bool fix_length_and_dec() { decimals=0; max_length=2; return FALSE; }
+ bool fix_length_and_dec() override { decimals=0; max_length=2; return FALSE; }
decimal_digits_t decimal_precision() const override { return 1; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isclosed>(thd, this); }
};
@@ -996,13 +1000,13 @@ class Item_func_isring: public Item_func_issimple
{
public:
Item_func_isring(THD *thd, Item *a): Item_func_issimple(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_isring") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_isring>(thd, this); }
};
@@ -1028,20 +1032,20 @@ class Item_func_x: public Item_real_func_args_geometry
{
public:
Item_func_x(THD *thd, Item *a): Item_real_func_args_geometry(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_x") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (Item_real_func::fix_length_and_dec())
return TRUE;
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_x>(thd, this); }
};
@@ -1050,20 +1054,20 @@ class Item_func_y: public Item_real_func_args_geometry
{
public:
Item_func_y(THD *thd, Item *a): Item_real_func_args_geometry(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_y") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (Item_real_func::fix_length_and_dec())
return TRUE;
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_y>(thd, this); }
};
@@ -1126,20 +1130,20 @@ class Item_func_area: public Item_real_func_args_geometry
{
public:
Item_func_area(THD *thd, Item *a): Item_real_func_args_geometry(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_area") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (Item_real_func::fix_length_and_dec())
return TRUE;
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_area>(thd, this); }
};
@@ -1150,20 +1154,20 @@ class Item_func_glength: public Item_real_func_args_geometry
public:
Item_func_glength(THD *thd, Item *a)
:Item_real_func_args_geometry(thd, a) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_length") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (Item_real_func::fix_length_and_dec())
return TRUE;
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_glength>(thd, this); }
};
@@ -1196,13 +1200,13 @@ class Item_func_distance: public Item_real_func_args_geometry_geometry
public:
Item_func_distance(THD *thd, Item *a, Item *b)
:Item_real_func_args_geometry_geometry(thd, a, b) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_distance") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_distance>(thd, this); }
};
@@ -1214,13 +1218,13 @@ class Item_func_sphere_distance: public Item_real_func
public:
Item_func_sphere_distance(THD *thd, List<Item> &list):
Item_real_func(thd, list) {}
- double val_real();
+ double val_real() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_distance_sphere") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sphere_distance>(thd, this); }
};
@@ -1239,12 +1243,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("st_pointonsurface") };
return name;
}
- String *val_str(String *);
- const Type_handler *type_handler() const
+ String *val_str(String *) override;
+ const Type_handler *type_handler() const override
{
return &type_handler_point;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_pointonsurface>(thd, this); }
};
@@ -1255,18 +1259,18 @@ class Item_func_gis_debug: public Item_long_func
public:
Item_func_gis_debug(THD *thd, Item *a): Item_long_func(thd, a)
{ null_value= false; }
- bool fix_length_and_dec() { fix_char_length(10); return FALSE; }
+ bool fix_length_and_dec() override { fix_char_length(10); return FALSE; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("st_gis_debug") };
return name;
}
- longlong val_int();
- bool check_vcol_func_processor(void *arg)
+ longlong val_int() override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_gis_debug>(thd, this); }
};
#endif
diff --git a/sql/item_jsonfunc.h b/sql/item_jsonfunc.h
index e09922dd5c1..a29a373b29e 100644
--- a/sql/item_jsonfunc.h
+++ b/sql/item_jsonfunc.h
@@ -82,13 +82,13 @@ protected:
public:
Item_func_json_valid(THD *thd, Item *json) : Item_bool_func(thd, json) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_valid") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
if (Item_bool_func::fix_length_and_dec())
return TRUE;
@@ -96,13 +96,14 @@ public:
return FALSE;
}
bool set_format_by_check_constraint(Send_field_extended_metadata *to) const
+ override
{
static const Lex_cstring fmt(STRING_WITH_LEN("json"));
return to->set_format_name(fmt);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_valid>(thd, this); }
- enum Functype functype() const { return JSON_VALID_FUNC; }
+ enum Functype functype() const override { return JSON_VALID_FUNC; }
};
@@ -120,10 +121,10 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_exists") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_exists>(thd, this); }
- longlong val_int();
+ longlong val_int() override;
};
@@ -217,9 +218,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_quote") };
return name;
}
- bool fix_length_and_dec();
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_quote>(thd, this); }
};
@@ -236,9 +237,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_unquote") };
return name;
}
- bool fix_length_and_dec();
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_unquote>(thd, this); }
};
@@ -271,14 +272,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_extract") };
return name;
}
- enum Functype functype() const { return JSON_EXTRACT_FUNC; }
- bool fix_length_and_dec();
- String *val_str(String *);
- longlong val_int();
- double val_real();
- my_decimal *val_decimal(my_decimal *);
- uint get_n_paths() const { return arg_count - 1; }
- Item *get_copy(THD *thd)
+ enum Functype functype() const override { return JSON_EXTRACT_FUNC; }
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ longlong val_int() override;
+ double val_real() override;
+ my_decimal *val_decimal(my_decimal *) override;
+ uint get_n_paths() const override { return arg_count - 1; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_extract>(thd, this); }
};
@@ -299,9 +300,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_contains") };
return name;
}
- bool fix_length_and_dec();
- longlong val_int();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_contains>(thd, this); }
};
@@ -324,11 +325,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_contains_path") };
return name;
}
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
- void cleanup();
- longlong val_int();
- Item *get_copy(THD *thd)
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
+ void cleanup() override;
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_contains_path>(thd, this); }
};
@@ -343,14 +344,14 @@ public:
Item_json_func(thd) {}
Item_func_json_array(THD *thd, List<Item> &list):
Item_json_func(thd, list) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_array") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_array>(thd, this); }
};
@@ -363,15 +364,15 @@ protected:
public:
Item_func_json_array_append(THD *thd, List<Item> &list):
Item_json_str_multipath(thd, list) {}
- bool fix_length_and_dec();
- String *val_str(String *);
- uint get_n_paths() const { return arg_count/2; }
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ uint get_n_paths() const override { return arg_count/2; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_array_append") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_array_append>(thd, this); }
};
@@ -381,13 +382,13 @@ class Item_func_json_array_insert: public Item_func_json_array_append
public:
Item_func_json_array_insert(THD *thd, List<Item> &list):
Item_func_json_array_append(thd, list) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_array_insert") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_array_insert>(thd, this); }
};
@@ -399,13 +400,13 @@ public:
Item_func_json_array(thd) {}
Item_func_json_object(THD *thd, List<Item> &list):
Item_func_json_array(thd, list) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_object") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_object>(thd, this); }
};
@@ -417,13 +418,13 @@ protected:
public:
Item_func_json_merge(THD *thd, List<Item> &list):
Item_func_json_array(thd, list) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_merge_preserve") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_merge>(thd, this); }
};
@@ -437,14 +438,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_merge_patch") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_merge_patch>(thd, this); }
};
class Item_func_json_length: public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_text(func_name_cstring()) ||
(arg_count > 1 &&
@@ -462,16 +463,16 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_length") };
return name;
}
- bool fix_length_and_dec();
- longlong val_int();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_length>(thd, this); }
};
class Item_func_json_depth: public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_text(func_name_cstring()); }
protected:
String tmp_js;
@@ -482,9 +483,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_depth") };
return name;
}
- bool fix_length_and_dec() { max_length= 10; return FALSE; }
- longlong val_int();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override { max_length= 10; return FALSE; }
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_depth>(thd, this); }
};
@@ -500,9 +501,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_type") };
return name;
}
- bool fix_length_and_dec();
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_type>(thd, this); }
};
@@ -517,9 +518,9 @@ public:
Item_func_json_insert(bool i_mode, bool r_mode, THD *thd, List<Item> &list):
Item_json_str_multipath(thd, list),
mode_insert(i_mode), mode_replace(r_mode) {}
- bool fix_length_and_dec();
- String *val_str(String *);
- uint get_n_paths() const { return arg_count/2; }
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ uint get_n_paths() const override { return arg_count/2; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING json_set= {STRING_WITH_LEN("json_set") };
@@ -528,7 +529,7 @@ public:
return (mode_insert ?
(mode_replace ? json_set : json_insert) : json_update);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_insert>(thd, this); }
};
@@ -540,15 +541,15 @@ protected:
public:
Item_func_json_remove(THD *thd, List<Item> &list):
Item_json_str_multipath(thd, list) {}
- bool fix_length_and_dec();
- String *val_str(String *);
- uint get_n_paths() const { return arg_count - 1; }
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ uint get_n_paths() const override { return arg_count - 1; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_remove") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_remove>(thd, this); }
};
@@ -567,9 +568,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_keys") };
return name;
}
- bool fix_length_and_dec();
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_keys>(thd, this); }
};
@@ -594,11 +595,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("json_search") };
return name;
}
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
- String *val_str(String *);
- uint get_n_paths() const { return arg_count > 4 ? arg_count - 4 : 0; }
- Item *get_copy(THD *thd)
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
+ String *val_str(String *) override;
+ uint get_n_paths() const override { return arg_count > 4 ? arg_count - 4 : 0; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_search>(thd, this); }
};
@@ -623,10 +624,10 @@ public:
Item_json_func(thd, list), fmt(DETAILED) {}
LEX_CSTRING func_name_cstring() const override;
- bool fix_length_and_dec();
- String *val_str(String *str);
- String *val_json(String *str);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ String *val_str(String *str) override;
+ String *val_json(String *str) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_format>(thd, this); }
};
@@ -638,12 +639,12 @@ protected:
Overrides Item_func_group_concat::skip_nulls()
NULL-s should be added to the result as JSON null value.
*/
- bool skip_nulls() const { return false; }
- String *get_str_from_item(Item *i, String *tmp);
+ bool skip_nulls() const override { return false; }
+ String *get_str_from_item(Item *i, String *tmp) override;
String *get_str_from_field(Item *i, Field *f, String *tmp,
- const uchar *key, size_t offset);
+ const uchar *key, size_t offset) override;
void cut_max_length(String *result,
- uint old_length, uint max_length) const;
+ uint old_length, uint max_length) const override;
public:
String m_tmp_json; /* Used in get_str_from_*.. */
Item_func_json_arrayagg(THD *thd, Name_resolution_context *context_arg,
@@ -655,18 +656,18 @@ public:
{
}
Item_func_json_arrayagg(THD *thd, Item_func_json_arrayagg *item);
- bool is_json_type() { return true; }
+ bool is_json_type() override { return true; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_arrayagg(") };
return name;
}
- enum Sumfunctype sum_func() const {return JSON_ARRAYAGG_FUNC;}
+ enum Sumfunctype sum_func() const override {return JSON_ARRAYAGG_FUNC;}
- String* val_str(String *str);
+ String* val_str(String *str) override;
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_arrayagg>(thd, this); }
};
@@ -683,44 +684,44 @@ public:
}
Item_func_json_objectagg(THD *thd, Item_func_json_objectagg *item);
- bool is_json_type() { return true; }
- void cleanup();
+ bool is_json_type() override { return true; }
+ void cleanup() override;
- enum Sumfunctype sum_func () const {return JSON_OBJECTAGG_FUNC;}
+ enum Sumfunctype sum_func () const override { return JSON_OBJECTAGG_FUNC;}
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("json_objectagg") };
return name;
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
if (too_big_for_varchar())
return &type_handler_blob;
return &type_handler_varchar;
}
- void clear();
- bool add();
- void reset_field() { DBUG_ASSERT(0); } // not used
- void update_field() { DBUG_ASSERT(0); } // not used
- bool fix_fields(THD *,Item **);
+ void clear() override;
+ bool add() override;
+ void reset_field() override { DBUG_ASSERT(0); } // not used
+ void update_field() override { DBUG_ASSERT(0); } // not used
+ bool fix_fields(THD *,Item **) override;
- double val_real()
+ double val_real() override
{ return 0.0; }
- longlong val_int()
+ longlong val_int() override
{ return 0; }
- my_decimal *val_decimal(my_decimal *decimal_value)
+ my_decimal *val_decimal(my_decimal *decimal_value) override
{
my_decimal_set_zero(decimal_value);
return decimal_value;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return get_date_from_string(thd, ltime, fuzzydate);
}
- String* val_str(String* str);
- Item *copy_or_same(THD* thd);
- void no_rows_in_result() {}
- Item *get_copy(THD *thd)
+ String *val_str(String* str) override;
+ Item *copy_or_same(THD* thd) override;
+ void no_rows_in_result() override {}
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_json_objectagg>(thd, this); }
};
diff --git a/sql/item_row.h b/sql/item_row.h
index 9b8620836b2..fbf632ba3b7 100644
--- a/sql/item_row.h
+++ b/sql/item_row.h
@@ -54,101 +54,103 @@ public:
not_null_tables_cache(0), with_null(0)
{ }
- enum Type type() const { return ROW_ITEM; };
- const Type_handler *type_handler() const { return &type_handler_row; }
+ enum Type type() const override { return ROW_ITEM; };
+ const Type_handler *type_handler() const override { return &type_handler_row; }
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
return NULL; // Check with Vicentiu why it's called for Item_row
}
void illegal_method_call(const char *);
- bool is_null() { return null_value; }
- void make_send_field(THD *thd, Send_field *)
+ bool is_null() override { return null_value; }
+ void make_send_field(THD *thd, Send_field *) override
{
illegal_method_call((const char*)"make_send_field");
};
- double val_real()
+ double val_real() override
{
illegal_method_call((const char*)"val");
return 0;
};
- longlong val_int()
+ longlong val_int() override
{
illegal_method_call((const char*)"val_int");
return 0;
};
- String *val_str(String *)
+ String *val_str(String *) override
{
illegal_method_call((const char*)"val_str");
return 0;
};
- my_decimal *val_decimal(my_decimal *)
+ my_decimal *val_decimal(my_decimal *) override
{
illegal_method_call((const char*)"val_decimal");
return 0;
};
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
illegal_method_call((const char*)"get_date");
return true;
}
- bool fix_fields(THD *thd, Item **ref);
- void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge);
- void cleanup();
+ bool fix_fields(THD *thd, Item **ref) override;
+ void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
+ override;
+ void cleanup() override;
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
- List<Item> &fields, uint flags);
- table_map used_tables() const { return used_tables_cache; };
- bool const_item() const { return const_item_cache; };
- void update_used_tables()
+ List<Item> &fields, uint flags) override;
+ table_map used_tables() const override { return used_tables_cache; };
+ bool const_item() const override { return const_item_cache; };
+ void update_used_tables() override
{
used_tables_and_const_cache_init();
used_tables_and_const_cache_update_and_join(arg_count, args);
}
- table_map not_null_tables() const { return not_null_tables_cache; }
- virtual void print(String *str, enum_query_type query_type);
+ table_map not_null_tables() const override { return not_null_tables_cache; }
+ void print(String *str, enum_query_type query_type) override;
- bool walk(Item_processor processor, bool walk_subquery, void *arg)
+ bool walk(Item_processor processor, bool walk_subquery, void *arg) override
{
if (walk_args(processor, walk_subquery, arg))
return true;
return (this->*processor)(arg);
}
- Item *transform(THD *thd, Item_transformer transformer, uchar *arg);
- bool eval_not_null_tables(void *opt_arg);
- bool find_not_null_fields(table_map allowed);
+ Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
+ bool eval_not_null_tables(void *opt_arg) override;
+ bool find_not_null_fields(table_map allowed) override;
- uint cols() const { return arg_count; }
- Item* element_index(uint i) { return args[i]; }
- Item** addr(uint i) { return args + i; }
- bool check_cols(uint c);
- bool null_inside() { return with_null; };
- void bring_value();
+ uint cols() const override { return arg_count; }
+ Item* element_index(uint i) override { return args[i]; }
+ Item** addr(uint i) override { return args + i; }
+ bool check_cols(uint c) override;
+ bool null_inside() override { return with_null; };
+ void bring_value() override;
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{
Item_args::propagate_equal_fields(thd, Context_identity(), cond);
return this;
}
- bool excl_dep_on_table(table_map tab_map)
+ bool excl_dep_on_table(table_map tab_map) override
{
return Item_args::excl_dep_on_table(tab_map);
}
- bool excl_dep_on_grouping_fields(st_select_lex *sel)
+ bool excl_dep_on_grouping_fields(st_select_lex *sel) override
{
return Item_args::excl_dep_on_grouping_fields(sel);
}
- bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred)
+ bool excl_dep_on_in_subq_left_part(Item_in_subselect *subq_pred) override
{
return Item_args::excl_dep_on_in_subq_left_part(subq_pred);
}
- bool check_vcol_func_processor(void *arg) {return FALSE; }
- Item *get_copy(THD *thd)
+ bool check_vcol_func_processor(void *arg) override {return FALSE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_row>(thd, this); }
- Item *build_clone(THD *thd);
+ Item *build_clone(THD *thd) override;
};
#endif /* ITEM_ROW_INCLUDED */
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index bc77edfd095..84d2c07e119 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -64,14 +64,15 @@ public:
Item_func(thd, a, b, c, d, e) { decimals=NOT_FIXED_DEC; }
Item_str_func(THD *thd, List<Item> &list):
Item_func(thd, list) { decimals=NOT_FIXED_DEC; }
- longlong val_int();
- double val_real();
- my_decimal *val_decimal(my_decimal *);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ longlong val_int() override;
+ double val_real() override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{ return get_date_from_string(thd, ltime, fuzzydate); }
- const Type_handler *type_handler() const { return string_type_handler(); }
+ const Type_handler *type_handler() const override
+ { return string_type_handler(); }
void left_right_max_length();
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_fields(THD *thd, Item **ref) override;
};
@@ -88,11 +89,11 @@ public:
Item_str_ascii_func(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
Item_str_ascii_func(THD *thd, Item *a, Item *b, Item *c):
Item_str_func(thd, a, b, c) {}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
return val_str_from_val_str_ascii(str, &ascii_buf);
}
- String *val_str_ascii(String *)= 0;
+ String *val_str_ascii(String *) override= 0;
};
@@ -143,8 +144,8 @@ class Item_func_md5 :public Item_str_ascii_checksum_func
{
public:
Item_func_md5(THD *thd, Item *a): Item_str_ascii_checksum_func(thd, a) {}
- String *val_str_ascii(String *);
- bool fix_length_and_dec()
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override
{
fix_length_and_charset(32, default_charset());
return FALSE;
@@ -154,7 +155,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("md5") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_md5>(thd, this); }
};
@@ -163,14 +164,14 @@ class Item_func_sha :public Item_str_ascii_checksum_func
{
public:
Item_func_sha(THD *thd, Item *a): Item_str_ascii_checksum_func(thd, a) {}
- String *val_str_ascii(String *);
- bool fix_length_and_dec();
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("sha") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sha>(thd, this); }
};
@@ -179,14 +180,14 @@ class Item_func_sha2 :public Item_str_ascii_checksum_func
public:
Item_func_sha2(THD *thd, Item *a, Item *b)
:Item_str_ascii_checksum_func(thd, a, b) {}
- String *val_str_ascii(String *);
- bool fix_length_and_dec();
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("sha2") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sha2>(thd, this); }
};
@@ -196,14 +197,14 @@ class Item_func_to_base64 :public Item_str_ascii_checksum_func
public:
Item_func_to_base64(THD *thd, Item *a)
:Item_str_ascii_checksum_func(thd, a) {}
- String *val_str_ascii(String *);
- bool fix_length_and_dec();
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("to_base64") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_to_base64>(thd, this); }
};
@@ -213,14 +214,14 @@ class Item_func_from_base64 :public Item_str_binary_checksum_func
public:
Item_func_from_base64(THD *thd, Item *a)
:Item_str_binary_checksum_func(thd, a) { }
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("from_base64") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_from_base64>(thd, this); }
};
@@ -245,13 +246,13 @@ class Item_func_aes_encrypt :public Item_aes_crypt
public:
Item_func_aes_encrypt(THD *thd, Item *a, Item *b)
:Item_aes_crypt(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("aes_encrypt") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_aes_encrypt>(thd, this); }
};
@@ -260,13 +261,13 @@ class Item_func_aes_decrypt :public Item_aes_crypt
public:
Item_func_aes_decrypt(THD *thd, Item *a, Item *b):
Item_aes_crypt(thd, a, b) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("aes_decrypt") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_aes_decrypt>(thd, this); }
};
@@ -287,14 +288,14 @@ protected:
public:
Item_func_concat(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
Item_func_concat(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("concat") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_concat>(thd, this); }
};
@@ -312,13 +313,13 @@ public:
Item_func_concat_operator_oracle(THD *thd, Item *a, Item *b)
:Item_func_concat(thd, a, b)
{ }
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("concat_operator_oracle") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{
return get_item_copy<Item_func_concat_operator_oracle>(thd, this);
}
@@ -330,8 +331,8 @@ class Item_func_decode_histogram :public Item_str_func
public:
Item_func_decode_histogram(THD *thd, Item *a, Item *b):
Item_str_func(thd, a, b) {}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
collation.set(system_charset_info);
max_length= MAX_BLOB_WIDTH;
@@ -343,7 +344,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("decode_histogram") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_decode_histogram>(thd, this); }
};
@@ -352,15 +353,15 @@ class Item_func_concat_ws :public Item_str_func
String tmp_value;
public:
Item_func_concat_ws(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("concat_ws") };
return name;
}
- table_map not_null_tables() const { return 0; }
- Item *get_copy(THD *thd)
+ table_map not_null_tables() const override { return 0; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_concat_ws>(thd, this); }
};
@@ -369,14 +370,14 @@ class Item_func_reverse :public Item_str_func
String tmp_value;
public:
Item_func_reverse(THD *thd, Item *a): Item_str_func(thd, a) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("reverse") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_reverse>(thd, this); }
};
@@ -387,15 +388,15 @@ class Item_func_replace :public Item_str_func
public:
Item_func_replace(THD *thd, Item *org, Item *find, Item *replace):
Item_str_func(thd, org, find, replace) {}
- String *val_str(String *to) { return val_str_internal(to, NULL); };
- bool fix_length_and_dec();
+ String *val_str(String *to) override { return val_str_internal(to, NULL); };
+ bool fix_length_and_dec() override;
String *val_str_internal(String *str, String *empty_string_for_null);
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("replace") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_replace>(thd, this); }
};
@@ -406,13 +407,14 @@ class Item_func_replace_oracle :public Item_func_replace
public:
Item_func_replace_oracle(THD *thd, Item *org, Item *find, Item *replace):
Item_func_replace(thd, org, find, replace) {}
- String *val_str(String *to) { return val_str_internal(to, &tmp_emtpystr); };
+ String *val_str(String *to) override
+ { return val_str_internal(to, &tmp_emtpystr); };
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("replace_oracle") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_replace_oracle>(thd, this); }
};
@@ -427,21 +429,21 @@ public:
Item_func_regexp_replace(THD *thd, Item *a, Item *b, Item *c):
Item_str_func(thd, a, b, c)
{}
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_regexp_replace::cleanup");
Item_str_func::cleanup();
re.cleanup();
DBUG_VOID_RETURN;
}
- String *val_str(String *str);
- bool fix_length_and_dec();
+ String *val_str(String *str) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("regexp_replace") };
return name;
}
- Item *get_copy(THD *thd) { return 0;}
+ Item *get_copy(THD *thd) override { return 0;}
};
@@ -452,21 +454,21 @@ public:
Item_func_regexp_substr(THD *thd, Item *a, Item *b):
Item_str_func(thd, a, b)
{}
- void cleanup()
+ void cleanup() override
{
DBUG_ENTER("Item_func_regexp_substr::cleanup");
Item_str_func::cleanup();
re.cleanup();
DBUG_VOID_RETURN;
}
- String *val_str(String *str);
- bool fix_length_and_dec();
+ String *val_str(String *str) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("regexp_substr") };
return name;
}
- Item *get_copy(THD *thd) { return 0; }
+ Item *get_copy(THD *thd) override { return 0; }
};
@@ -477,14 +479,14 @@ public:
Item_func_insert(THD *thd, Item *org, Item *start, Item *length,
Item *new_str):
Item_str_func(thd, org, start, length, new_str) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("insert") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_insert>(thd, this); }
};
@@ -497,7 +499,7 @@ protected:
String tmp_value;
public:
Item_str_conv(THD *thd, Item *item): Item_str_func(thd, item) {}
- String *val_str(String *);
+ String *val_str(String *) override;
};
@@ -510,8 +512,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("lcase") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_lcase>(thd, this); }
};
@@ -524,8 +526,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("ucase") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ucase>(thd, this); }
};
@@ -535,14 +537,14 @@ class Item_func_left :public Item_str_func
String tmp_value;
public:
Item_func_left(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("left") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_left>(thd, this); }
};
@@ -552,14 +554,14 @@ class Item_func_right :public Item_str_func
String tmp_value;
public:
Item_func_right(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("right") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_right>(thd, this); }
};
@@ -573,30 +575,30 @@ public:
Item_func_substr(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
Item_func_substr(THD *thd, Item *a, Item *b, Item *c):
Item_str_func(thd, a, b, c) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("substr") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_substr>(thd, this); }
};
class Item_func_substr_oracle :public Item_func_substr
{
protected:
- longlong get_position()
+ longlong get_position() override
{ longlong pos= args[1]->val_int(); return pos == 0 ? 1 : pos; }
- String *make_empty_result()
+ String *make_empty_result() override
{ null_value= 1; return NULL; }
public:
Item_func_substr_oracle(THD *thd, Item *a, Item *b):
Item_func_substr(thd, a, b) {}
Item_func_substr_oracle(THD *thd, Item *a, Item *b, Item *c):
Item_func_substr(thd, a, b, c) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_func_substr::fix_length_and_dec();
set_maybe_null();
@@ -607,7 +609,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("substr_oracle") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_substr_oracle>(thd, this); }
};
@@ -617,14 +619,14 @@ class Item_func_substr_index :public Item_str_func
public:
Item_func_substr_index(THD *thd, Item *a,Item *b,Item *c):
Item_str_func(thd, a, b, c) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("substring_index") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_substr_index>(thd, this); }
};
@@ -661,17 +663,17 @@ protected:
public:
Item_func_trim(THD *thd, Item *a, Item *b): Item_str_func(thd, a, b) {}
Item_func_trim(THD *thd, Item *a): Item_str_func(thd, a) {}
- Sql_mode_dependency value_depends_on_sql_mode() const;
- String *val_str(String *);
- bool fix_length_and_dec();
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("trim") };
return name;
}
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
virtual LEX_CSTRING mode_name() const { return { "both", 4}; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trim>(thd, this); }
};
@@ -679,7 +681,7 @@ public:
class Item_func_trim_oracle :public Item_func_trim
{
protected:
- String *make_empty_result()
+ String *make_empty_result() override
{ null_value= 1; return NULL; }
LEX_CSTRING func_name_ext() const override
{
@@ -695,13 +697,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("trim_oracle") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_func_trim::fix_length_and_dec();
set_maybe_null();
return res;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trim_oracle>(thd, this); }
};
@@ -711,11 +713,11 @@ class Item_func_ltrim :public Item_func_trim
public:
Item_func_ltrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {}
Item_func_ltrim(THD *thd, Item *a): Item_func_trim(thd, a) {}
- Sql_mode_dependency value_depends_on_sql_mode() const
+ Sql_mode_dependency value_depends_on_sql_mode() const override
{
return Item_func::value_depends_on_sql_mode();
}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("ltrim") };
@@ -723,7 +725,7 @@ public:
}
LEX_CSTRING mode_name() const override
{ return { STRING_WITH_LEN("leading") }; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ltrim>(thd, this); }
};
@@ -731,7 +733,7 @@ public:
class Item_func_ltrim_oracle :public Item_func_ltrim
{
protected:
- String *make_empty_result()
+ String *make_empty_result() override
{ null_value= 1; return NULL; }
LEX_CSTRING func_name_ext() const override
{
@@ -747,13 +749,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("ltrim_oracle") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_func_ltrim::fix_length_and_dec();
set_maybe_null();
return res;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_ltrim_oracle>(thd, this); }
};
@@ -763,7 +765,7 @@ class Item_func_rtrim :public Item_func_trim
public:
Item_func_rtrim(THD *thd, Item *a, Item *b): Item_func_trim(thd, a, b) {}
Item_func_rtrim(THD *thd, Item *a): Item_func_trim(thd, a) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("rtrim") };
@@ -771,7 +773,7 @@ public:
}
LEX_CSTRING mode_name() const override
{ return { STRING_WITH_LEN("trailing") }; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rtrim>(thd, this); }
};
@@ -779,7 +781,7 @@ public:
class Item_func_rtrim_oracle :public Item_func_rtrim
{
protected:
- String *make_empty_result()
+ String *make_empty_result() override
{ null_value= 1; return NULL; }
LEX_CSTRING func_name_ext() const override
{
@@ -795,13 +797,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("rtrim_oracle") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_func_rtrim::fix_length_and_dec();
set_maybe_null();
return res;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rtrim_oracle>(thd, this); }
};
@@ -826,9 +828,9 @@ public:
Item_str_ascii_checksum_func(thd, a), alg(NEW), deflt(1) {}
Item_func_password(THD *thd, Item *a, PW_Alg al):
Item_str_ascii_checksum_func(thd, a), alg(al), deflt(0) {}
- String *val_str_ascii(String *str);
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec()
+ String *val_str_ascii(String *str) override;
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override
{
fix_length_and_charset((alg == 1 ?
SCRAMBLED_PASSWORD_CHAR_LENGTH :
@@ -844,7 +846,7 @@ public:
}
static char *alloc(THD *thd, const char *password, size_t pass_len,
enum PW_Alg al);
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_password>(thd, this); }
};
@@ -858,8 +860,8 @@ public:
:Item_str_binary_checksum_func(thd, a) {}
Item_func_des_encrypt(THD *thd, Item *a, Item *b)
:Item_str_binary_checksum_func(thd, a, b) {}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
set_maybe_null();
/* 9 = MAX ((8- (arg_len % 8)) + 1) */
@@ -871,7 +873,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("des_encrypt") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_des_encrypt>(thd, this); }
};
@@ -883,8 +885,8 @@ public:
:Item_str_binary_checksum_func(thd, a) {}
Item_func_des_decrypt(THD *thd, Item *a, Item *b)
:Item_str_binary_checksum_func(thd, a, b) {}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
set_maybe_null();
/* 9 = MAX ((8- (arg_len % 8)) + 1) */
@@ -898,7 +900,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("des_decrypt") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_des_decrypt>(thd, this); }
};
@@ -927,8 +929,8 @@ public:
{
constructor_helper();
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
set_maybe_null();
max_length = 13;
@@ -939,11 +941,11 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("encrypt") };
return name;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_encrypt>(thd, this); }
};
@@ -960,14 +962,14 @@ protected:
public:
Item_func_encode(THD *thd, Item *a, Item *seed_arg):
Item_str_binary_checksum_func(thd, a, seed_arg) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("encode") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_encode>(thd, this); }
protected:
virtual void crypto_transform(String *);
@@ -986,10 +988,10 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("decode") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_decode>(thd, this); }
protected:
- void crypto_transform(String *);
+ void crypto_transform(String *) override;
};
@@ -1018,8 +1020,8 @@ class Item_func_database :public Item_func_sysconst
{
public:
Item_func_database(THD *thd): Item_func_sysconst(thd) {}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen;
set_maybe_null();
@@ -1030,8 +1032,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("database") };
return name;
}
- const char *fully_qualified_func_name() const { return "database()"; }
- Item *get_copy(THD *thd)
+ const char *fully_qualified_func_name() const override
+ { return "database()"; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_database>(thd, this); }
};
@@ -1040,25 +1043,26 @@ class Item_func_sqlerrm :public Item_func_sysconst
{
public:
Item_func_sqlerrm(THD *thd): Item_func_sysconst(thd) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("SQLERRM") };
return name;
}
- const char *fully_qualified_func_name() const { return "SQLERRM"; }
- void print(String *str, enum_query_type query_type)
+ const char *fully_qualified_func_name() const override
+ { return "SQLERRM"; }
+ void print(String *str, enum_query_type query_type) override
{
str->append(func_name_cstring());
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= 512 * system_charset_info->mbmaxlen;
null_value= false;
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sqlerrm>(thd, this); }
};
@@ -1073,13 +1077,13 @@ public:
{
str_value.set("", 0, system_charset_info);
}
- String *val_str(String *)
+ String *val_str(String *) override
{
DBUG_ASSERT(fixed());
return (null_value ? 0 : &str_value);
}
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec()
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override
{
max_length= (uint32) (username_char_length +
HOSTNAME_LENGTH + 1) * SYSTEM_CHARSET_MBMAXLEN;
@@ -1090,12 +1094,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("user") };
return name;
}
- const char *fully_qualified_func_name() const { return "user()"; }
- int save_in_field(Field *field, bool no_conversions)
+ const char *fully_qualified_func_name() const override
+ { return "user()"; }
+ int save_in_field(Field *field, bool no_conversions) override
{
return save_str_value_in_field(field, &str_value);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_user>(thd, this); }
};
@@ -1107,14 +1112,15 @@ class Item_func_current_user :public Item_func_user
public:
Item_func_current_user(THD *thd, Name_resolution_context *context_arg):
Item_func_user(thd), context(context_arg) {}
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_fields(THD *thd, Item **ref) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("current_user") };
return name;
}
- const char *fully_qualified_func_name() const { return "current_user()"; }
- bool check_vcol_func_processor(void *arg)
+ const char *fully_qualified_func_name() const override
+ { return "current_user()"; }
+ bool check_vcol_func_processor(void *arg) override
{
context= 0;
return mark_unsupported_function(fully_qualified_func_name(), arg,
@@ -1130,32 +1136,33 @@ class Item_func_current_role :public Item_func_sysconst
public:
Item_func_current_role(THD *thd, Name_resolution_context *context_arg):
Item_func_sysconst(thd), context(context_arg) {}
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec()
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override
{
max_length= (uint32) username_char_length * SYSTEM_CHARSET_MBMAXLEN;
return FALSE;
}
- int save_in_field(Field *field, bool no_conversions)
+ int save_in_field(Field *field, bool no_conversions) override
{ return save_str_value_in_field(field, &str_value); }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("current_role") };
return name;
}
- const char *fully_qualified_func_name() const { return "current_role()"; }
- String *val_str(String *)
+ const char *fully_qualified_func_name() const override
+ { return "current_role()"; }
+ String *val_str(String *) override
{
DBUG_ASSERT(fixed());
return null_value ? NULL : &str_value;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
context= 0;
return mark_unsupported_function(fully_qualified_func_name(), arg,
VCOL_SESSION_FUNC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_current_role>(thd, this); }
};
@@ -1165,14 +1172,14 @@ class Item_func_soundex :public Item_str_func
String tmp_value;
public:
Item_func_soundex(THD *thd, Item *a): Item_str_func(thd, a) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("soundex") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_soundex>(thd, this); }
};
@@ -1181,16 +1188,16 @@ class Item_func_elt :public Item_str_func
{
public:
Item_func_elt(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
- double val_real();
- longlong val_int();
- String *val_str(String *str);
- bool fix_length_and_dec();
+ double val_real() override;
+ longlong val_int() override;
+ String *val_str(String *str) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("elt") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_elt>(thd, this); }
};
@@ -1201,14 +1208,14 @@ class Item_func_make_set :public Item_str_func
public:
Item_func_make_set(THD *thd, List<Item> &list): Item_str_func(thd, list) {}
- String *val_str(String *str);
- bool fix_length_and_dec();
+ String *val_str(String *str) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("make_set") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_make_set>(thd, this); }
};
@@ -1222,14 +1229,14 @@ public:
Item_func_format(THD *thd, Item *org, Item *dec, Item *lang):
Item_str_ascii_func(thd, org, dec, lang) {}
- String *val_str_ascii(String *);
- bool fix_length_and_dec();
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("format") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_format>(thd, this); }
};
@@ -1245,9 +1252,9 @@ public:
Item_func_char(THD *thd, Item *arg1, CHARSET_INFO *cs):
Item_str_func(thd, arg1)
{ collation.set(cs); }
- String *val_str(String *);
+ String *val_str(String *) override;
void append_char(String * str, int32 num);
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= arg_count * 4;
return FALSE;
@@ -1257,8 +1264,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("char") };
return name;
}
- void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_char>(thd, this); }
};
@@ -1267,8 +1274,8 @@ class Item_func_chr :public Item_func_char
public:
Item_func_chr(THD *thd, Item *arg1, CHARSET_INFO *cs):
Item_func_char(thd, arg1, cs) {}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
max_length= 4;
return FALSE;
@@ -1278,7 +1285,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("chr") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_chr>(thd, this); }
};
@@ -1288,14 +1295,14 @@ class Item_func_repeat :public Item_str_func
public:
Item_func_repeat(THD *thd, Item *arg1, Item *arg2):
Item_str_func(thd, arg1, arg2) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("repeat") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_repeat>(thd, this); }
};
@@ -1304,14 +1311,14 @@ class Item_func_space :public Item_str_func
{
public:
Item_func_space(THD *thd, Item *arg1): Item_str_func(thd, arg1) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("space") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_space>(thd, this); }
};
@@ -1321,18 +1328,18 @@ class Item_func_binlog_gtid_pos :public Item_str_func
public:
Item_func_binlog_gtid_pos(THD *thd, Item *arg1, Item *arg2):
Item_str_func(thd, arg1, arg2) {}
- String *val_str(String *);
- bool fix_length_and_dec();
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("binlog_gtid_pos") };
return name;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_binlog_gtid_pos>(thd, this); }
};
@@ -1346,7 +1353,7 @@ public:
Item_str_func(thd, arg1, arg2, arg3) {}
Item_func_pad(THD *thd, Item *arg1, Item *arg2):
Item_str_func(thd, arg1, arg2) {}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
};
@@ -1357,28 +1364,28 @@ public:
Item_func_pad(thd, arg1, arg2, arg3) {}
Item_func_rpad(THD *thd, Item *arg1, Item *arg2):
Item_func_pad(thd, arg1, arg2) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("rpad") };
return name;
}
- Sql_mode_dependency value_depends_on_sql_mode() const;
- Item *get_copy(THD *thd)
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rpad>(thd, this); }
};
class Item_func_rpad_oracle :public Item_func_rpad
{
- String *make_empty_result()
+ String *make_empty_result() override
{ null_value= 1; return NULL; }
public:
Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3):
Item_func_rpad(thd, arg1, arg2, arg3) {}
Item_func_rpad_oracle(THD *thd, Item *arg1, Item *arg2):
Item_func_rpad(thd, arg1, arg2) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_func_rpad::fix_length_and_dec();
set_maybe_null();
@@ -1389,7 +1396,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("rpad_oracle") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_rpad_oracle>(thd, this); }
};
@@ -1401,27 +1408,27 @@ public:
Item_func_pad(thd, arg1, arg2, arg3) {}
Item_func_lpad(THD *thd, Item *arg1, Item *arg2):
Item_func_pad(thd, arg1, arg2) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("lpad") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_lpad>(thd, this); }
};
class Item_func_lpad_oracle :public Item_func_lpad
{
- String *make_empty_result()
+ String *make_empty_result() override
{ null_value= 1; return NULL; }
public:
Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2, Item *arg3):
Item_func_lpad(thd, arg1, arg2, arg3) {}
Item_func_lpad_oracle(THD *thd, Item *arg1, Item *arg2):
Item_func_lpad(thd, arg1, arg2) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_func_lpad::fix_length_and_dec();
set_maybe_null();
@@ -1432,7 +1439,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("lpad_oracle") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_lpad_oracle>(thd, this); }
};
@@ -1447,15 +1454,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("conv") };
return name;
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
collation.set(default_charset());
fix_char_length(64);
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_conv>(thd, this); }
};
@@ -1482,12 +1489,12 @@ public:
String *val_str_ascii_from_val_int(String *str);
String *val_str_ascii_from_val_real(String *str);
String *val_str_ascii_from_val_str(String *str);
- String *val_str_ascii(String *str)
+ String *val_str_ascii(String *str) override
{
DBUG_ASSERT(fixed());
return m_arg0_type_handler->Item_func_hex_val_str_ascii(this, str);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
collation.set(default_charset(), DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII);
decimals=0;
@@ -1495,7 +1502,7 @@ public:
m_arg0_type_handler= args[0]->type_handler();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_hex>(thd, this); }
};
@@ -1513,15 +1520,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("unhex") };
return name;
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
collation.set(&my_charset_bin);
decimals=0;
max_length=(1+args[0]->max_length)/2;
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_unhex>(thd, this); }
};
@@ -1539,8 +1546,8 @@ public:
{
set_maybe_null();
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
collation.set(args[0]->collation);
decimals=0;
@@ -1560,7 +1567,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("like_range_min") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_like_range_min>(thd, this); }
};
@@ -1575,7 +1582,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("like_range_max") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_like_range_max>(thd, this); }
};
#endif
@@ -1585,7 +1592,7 @@ class Item_func_binary :public Item_str_func
{
public:
Item_func_binary(THD *thd, Item *a): Item_str_func(thd, a) {}
- String *val_str(String *a)
+ String *val_str(String *a) override
{
DBUG_ASSERT(fixed());
String *tmp=args[0]->val_str(a);
@@ -1594,20 +1601,20 @@ public:
tmp->set_charset(&my_charset_bin);
return tmp;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
collation.set(&my_charset_bin);
max_length=args[0]->max_length;
return FALSE;
}
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_binary") };
return name;
}
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_binary>(thd, this); }
};
@@ -1617,24 +1624,24 @@ class Item_load_file :public Item_str_func
String tmp_value;
public:
Item_load_file(THD *thd, Item *a): Item_str_func(thd, a) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("load_file") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
set_maybe_null();
max_length=MAX_BLOB_WIDTH;
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_IMPOSSIBLE);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_load_file>(thd, this); }
};
@@ -1648,14 +1655,14 @@ class Item_func_export_set: public Item_str_func
Item_str_func(thd, a, b, c, d) {}
Item_func_export_set(THD *thd, Item *a, Item *b, Item* c, Item* d, Item* e):
Item_str_func(thd, a, b, c, d, e) {}
- String *val_str(String *str);
- bool fix_length_and_dec();
+ String *val_str(String *str) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("export_set") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_export_set>(thd, this); }
};
@@ -1670,8 +1677,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("quote") };
return name;
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
collation.set(args[0]->collation);
ulonglong max_result_length= (ulonglong) args[0]->max_length * 2 +
@@ -1679,7 +1686,7 @@ public:
max_length= (uint32) MY_MIN(max_result_length, MAX_BLOB_WIDTH);
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_quote>(thd, this); }
};
@@ -1731,9 +1738,9 @@ public:
(cs->mbmaxlen > 1 || !(cs->state & MY_CS_NONASCII))));
}
}
- bool is_json_type() { return args[0]->is_json_type(); }
- String *val_str(String *);
- longlong val_int()
+ bool is_json_type() override { return args[0]->is_json_type(); }
+ String *val_str(String *) override;
+ longlong val_int() override
{
if (args[0]->result_type() == STRING_RESULT)
return Item_str_func::val_int();
@@ -1742,7 +1749,7 @@ public:
return 0;
return res;
}
- double val_real()
+ double val_real() override
{
if (args[0]->result_type() == STRING_RESULT)
return Item_str_func::val_real();
@@ -1751,7 +1758,7 @@ public:
return 0;
return res;
}
- my_decimal *val_decimal(my_decimal *d)
+ my_decimal *val_decimal(my_decimal *d) override
{
if (args[0]->result_type() == STRING_RESULT)
return Item_str_func::val_decimal(d);
@@ -1760,7 +1767,7 @@ public:
return NULL;
return res;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
if (args[0]->result_type() == STRING_RESULT)
return Item_str_func::get_date(thd, ltime, fuzzydate);
@@ -1769,14 +1776,14 @@ public:
return 1;
return res;
}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("convert") };
return name;
}
- void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_conv_charset>(thd, this); }
};
@@ -1786,24 +1793,24 @@ class Item_func_set_collation :public Item_str_func
public:
Item_func_set_collation(THD *thd, Item *a, CHARSET_INFO *set_collation):
Item_str_func(thd, a), m_set_collation(set_collation) {}
- String *val_str(String *);
- bool fix_length_and_dec();
- bool eq(const Item *item, bool binary_cmp) const;
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
+ bool eq(const Item *item, bool binary_cmp) const override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("collate") };
return name;
}
- enum precedence precedence() const { return COLLATE_PRECEDENCE; }
- enum Functype functype() const { return COLLATE_FUNC; }
- void print(String *str, enum_query_type query_type);
- Item_field *field_for_view_update()
+ enum precedence precedence() const override { return COLLATE_PRECEDENCE; }
+ enum Functype functype() const override { return COLLATE_FUNC; }
+ void print(String *str, enum_query_type query_type) override;
+ Item_field *field_for_view_update() override
{
/* this function is transparent for view updating */
return args[0]->field_for_view_update();
}
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_set_collation>(thd, this); }
};
@@ -1812,17 +1819,18 @@ class Item_func_expr_str_metadata :public Item_str_func
{
public:
Item_func_expr_str_metadata(THD *thd, Item *a): Item_str_func(thd, a) { }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough
base_flags&= ~item_base_t::MAYBE_NULL;
return FALSE;
};
- table_map not_null_tables() const { return 0; }
+ table_map not_null_tables() const override { return 0; }
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{ return this; }
- bool const_item() const { return true; }
+ bool const_item() const override { return true; }
};
@@ -1831,13 +1839,13 @@ class Item_func_charset :public Item_func_expr_str_metadata
public:
Item_func_charset(THD *thd, Item *a)
:Item_func_expr_str_metadata(thd, a) { }
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("charset") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_charset>(thd, this); }
};
@@ -1847,13 +1855,13 @@ class Item_func_collation :public Item_func_expr_str_metadata
public:
Item_func_collation(THD *thd, Item *a)
:Item_func_expr_str_metadata(thd, a) {}
- String *val_str(String *);
+ String *val_str(String *) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("collation") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_collation>(thd, this); }
};
@@ -1878,9 +1886,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("weight_string") };
return name;
}
- String *val_str(String *);
- bool fix_length_and_dec();
- bool eq(const Item *item, bool binary_cmp) const
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override;
+ bool eq(const Item *item, bool binary_cmp) const override
{
if (!Item_str_func::eq(item, binary_cmp))
return false;
@@ -1890,15 +1898,16 @@ public:
this->result_length == that->result_length;
}
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
+ override
{ return this; }
- void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_weight_string>(thd, this); }
};
class Item_func_crc32 :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_str(func_name_cstring()); }
String value;
public:
@@ -1909,9 +1918,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("crc32") };
return name;
}
- bool fix_length_and_dec() { max_length=10; return FALSE; }
- longlong val_int();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override { max_length=10; return FALSE; }
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_crc32>(thd, this); }
};
@@ -1926,13 +1935,13 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("uncompressed_length") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length=10;
set_maybe_null();
return FALSE; }
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_uncompressed_length>(thd, this); }
};
@@ -1948,7 +1957,7 @@ class Item_func_compress: public Item_str_binary_checksum_func
public:
Item_func_compress(THD *thd, Item *a)
:Item_str_binary_checksum_func(thd, a) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= (args[0]->max_length * 120) / 100 + 12;
return FALSE;
@@ -1958,8 +1967,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("compress") };
return name;
}
- String *val_str(String *) ZLIB_DEPENDED_FUNCTION
- Item *get_copy(THD *thd)
+ String *val_str(String *) override ZLIB_DEPENDED_FUNCTION
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_compress>(thd, this); }
};
@@ -1969,7 +1978,7 @@ class Item_func_uncompress: public Item_str_binary_checksum_func
public:
Item_func_uncompress(THD *thd, Item *a)
:Item_str_binary_checksum_func(thd, a) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
set_maybe_null();
max_length= MAX_BLOB_WIDTH;
@@ -1980,8 +1989,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("uncompress") };
return name;
}
- String *val_str(String *) ZLIB_DEPENDED_FUNCTION
- Item *get_copy(THD *thd)
+ String *val_str(String *) override ZLIB_DEPENDED_FUNCTION
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_uncompress>(thd, this); }
};
@@ -1990,26 +1999,26 @@ class Item_func_uuid: public Item_str_func
{
public:
Item_func_uuid(THD *thd): Item_str_func(thd) {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
collation.set(DTCollation_numeric());
fix_char_length(MY_UUID_STRING_LENGTH);
return FALSE;
}
- bool const_item() const { return false; }
- table_map used_tables() const { return RAND_TABLE_BIT; }
+ bool const_item() const override { return false; }
+ table_map used_tables() const override { return RAND_TABLE_BIT; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("uuid") };
return name;
}
- String *val_str(String *);
- bool check_vcol_func_processor(void *arg)
+ String *val_str(String *) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_NON_DETERMINISTIC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_uuid>(thd, this); }
};
@@ -2026,17 +2035,17 @@ protected:
void print_arguments(String *str, enum_query_type query_type);
public:
Item_func_dyncol_create(THD *thd, List<Item> &args, DYNCALL_CREATE_DEF *dfs);
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("column_create") };
return name;
}
- String *val_str(String *);
- void print(String *str, enum_query_type query_type);
- enum Functype functype() const { return DYNCOL_FUNC; }
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ void print(String *str, enum_query_type query_type) override;
+ enum Functype functype() const override { return DYNCOL_FUNC; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dyncol_create>(thd, this); }
};
@@ -2052,9 +2061,9 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("column_add") };
return name;
}
- String *val_str(String *);
- void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dyncol_add>(thd, this); }
};
@@ -2068,15 +2077,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("column_json") };
return name;
}
- String *val_str(String *);
- bool fix_length_and_dec()
+ String *val_str(String *) override;
+ bool fix_length_and_dec() override
{
max_length= MAX_BLOB_WIDTH;
set_maybe_null();
decimals= 0;
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dyncol_json>(thd, this); }
};
@@ -2089,23 +2098,23 @@ class Item_dyncol_get: public Item_str_func
public:
Item_dyncol_get(THD *thd, Item *str, Item *num): Item_str_func(thd, str, num)
{}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
set_maybe_null();
max_length= MAX_BLOB_WIDTH;
return FALSE;
}
/* Mark that collation can change between calls */
- bool dynamic_result() { return 1; }
+ bool dynamic_result() override { return 1; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("column_get") };
return name;
}
- String *val_str(String *);
- longlong val_int();
- longlong val_int_signed_typecast()
+ String *val_str(String *) override;
+ longlong val_int() override;
+ longlong val_int_signed_typecast() override
{
unsigned_flag= false; // Mark that we want to have a signed value
longlong value= val_int(); // val_int() can change unsigned_flag
@@ -2113,7 +2122,7 @@ public:
push_note_converted_to_negative_complement(current_thd);
return value;
}
- longlong val_int_unsigned_typecast()
+ longlong val_int_unsigned_typecast() override
{
unsigned_flag= true; // Mark that we want to have an unsigned value
longlong value= val_int(); // val_int() can change unsigned_flag
@@ -2121,12 +2130,12 @@ public:
push_note_converted_to_positive_complement(current_thd);
return value;
}
- double val_real();
- my_decimal *val_decimal(my_decimal *);
+ double val_real() override;
+ my_decimal *val_decimal(my_decimal *) override;
bool get_dyn_value(THD *thd, DYNAMIC_COLUMN_VALUE *val, String *tmp);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_dyncol_get>(thd, this); }
};
@@ -2136,7 +2145,7 @@ class Item_func_dyncol_list: public Item_str_func
public:
Item_func_dyncol_list(THD *thd, Item *str): Item_str_func(thd, str)
{collation.set(DYNCOL_UTF);}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
set_maybe_null();
max_length= MAX_BLOB_WIDTH;
@@ -2147,8 +2156,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("column_list") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dyncol_list>(thd, this); }
};
@@ -2162,18 +2171,19 @@ class Item_temptable_rowid :public Item_str_func
public:
TABLE *table;
Item_temptable_rowid(TABLE *table_arg);
- const Type_handler *type_handler() const { return &type_handler_string; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_string; }
Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table)
{ return create_table_field_from_handler(root, table); }
- String *val_str(String *str);
- enum Functype functype() const { return TEMPTABLE_ROWID; }
+ String *val_str(String *str) override;
+ enum Functype functype() const override { return TEMPTABLE_ROWID; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("<rowid>") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_temptable_rowid>(thd, this); }
};
#ifdef WITH_WSREP
@@ -2190,14 +2200,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_last_written_gtid") };
return name;
}
- String *val_str_ascii(String *);
- bool fix_length_and_dec()
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override
{
max_length= WSREP_GTID_STR_LEN;
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_wsrep_last_written_gtid>(thd, this); }
};
@@ -2211,14 +2221,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_last_seen_gtid") };
return name;
}
- String *val_str_ascii(String *);
- bool fix_length_and_dec()
+ String *val_str_ascii(String *) override;
+ bool fix_length_and_dec() override
{
max_length= WSREP_GTID_STR_LEN;
set_maybe_null();
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_wsrep_last_seen_gtid>(thd, this); }
};
@@ -2228,14 +2238,15 @@ class Item_func_wsrep_sync_wait_upto: public Item_int_func
public:
Item_func_wsrep_sync_wait_upto(THD *thd, Item *a): Item_int_func(thd, a) {}
Item_func_wsrep_sync_wait_upto(THD *thd, Item *a, Item* b): Item_int_func(thd, a, b) {}
- const Type_handler *type_handler() const { return &type_handler_string; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_string; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("wsrep_sync_wait_upto_gtid") };
return name;
}
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_wsrep_sync_wait_upto>(thd, this); }
};
#endif /* WITH_WSREP */
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index 43ee8fd9497..9509878d9c3 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -304,29 +304,30 @@ public:
Item_singlerow_subselect(THD *thd_arg): Item_subselect(thd_arg), value(0), row (0)
{}
- void cleanup();
- subs_type substype() { return SINGLEROW_SUBS; }
+ void cleanup() override;
+ subs_type substype() override { return SINGLEROW_SUBS; }
- void reset();
- void no_rows_in_result();
- bool select_transformer(JOIN *join);
+ void reset() override;
+ void no_rows_in_result() override;
+ bool select_transformer(JOIN *join) override;
void store(uint i, Item* item);
- double val_real();
- longlong val_int ();
- String *val_str (String *);
- bool val_native(THD *thd, Native *);
- my_decimal *val_decimal(my_decimal *);
- bool val_bool();
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- const Type_handler *type_handler() const;
- bool fix_length_and_dec();
+ double val_real() override;
+ longlong val_int() override;
+ String *val_str(String *) override;
+ bool val_native(THD *thd, Native *) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool val_bool() override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ const Type_handler *type_handler() const override;
+ bool fix_length_and_dec() override;
- uint cols() const;
- Item* element_index(uint i) { return reinterpret_cast<Item*>(row[i]); }
- Item** addr(uint i) { return (Item**)row + i; }
- bool check_cols(uint c);
- bool null_inside();
- void bring_value();
+ uint cols() const override;
+ Item* element_index(uint i) override
+ { return reinterpret_cast<Item*>(row[i]); }
+ Item** addr(uint i) override { return (Item**)row + i; }
+ bool check_cols(uint c) override;
+ bool null_inside() override;
+ void bring_value() override;
/**
This method is used to implement a special case of semantic tree
@@ -342,7 +343,7 @@ public:
*/
st_select_lex* invalidate_and_restore_select_lex();
- Item* expr_cache_insert_transformer(THD *thd, uchar *unused);
+ Item* expr_cache_insert_transformer(THD *thd, uchar *unused) override;
friend class select_singlerow_subselect;
};
@@ -357,12 +358,12 @@ protected:
public:
Item_maxmin_subselect(THD *thd, Item_subselect *parent,
st_select_lex *select_lex, bool max);
- virtual void print(String *str, enum_query_type query_type);
- void cleanup();
+ void print(String *str, enum_query_type query_type) override;
+ void cleanup() override;
bool any_value() { return was_values; }
void register_value() { was_values= TRUE; }
- void reset_value_registration() { was_values= FALSE; }
- void no_rows_in_result();
+ void reset_value_registration() override { was_values= FALSE; }
+ void no_rows_in_result() override;
};
/* exists subselect */
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 4f8cf996f55..414658fd830 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -411,7 +411,7 @@ public:
Item_sum(THD *thd, List<Item> &list);
//Copy constructor, need to perform subselects with temporary tables
Item_sum(THD *thd, Item_sum *item);
- enum Type type() const { return SUM_FUNC_ITEM; }
+ enum Type type() const override { return SUM_FUNC_ITEM; }
virtual enum Sumfunctype sum_func () const=0;
bool is_aggr_sum_func()
{
@@ -461,7 +461,7 @@ public:
Updated value is then saved in the field.
*/
virtual void update_field()=0;
- virtual bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
set_maybe_null();
null_value=1;
@@ -469,10 +469,10 @@ public:
}
virtual Item *result_item(THD *thd, Field *field);
- void update_used_tables ();
+ void update_used_tables() override;
COND *build_equal_items(THD *thd, COND_EQUAL *inherited,
bool link_item_fields,
- COND_EQUAL **cond_equal_ref)
+ COND_EQUAL **cond_equal_ref) override
{
/*
Item_sum (and derivants) of the original WHERE/HAVING clauses
@@ -483,7 +483,7 @@ public:
return Item::build_equal_items(thd, inherited, link_item_fields,
cond_equal_ref);
}
- bool is_null() { return null_value; }
+ bool is_null() override { return null_value; }
/**
make_const()
Called if we've managed to calculate the value of this Item in
@@ -496,8 +496,8 @@ public:
const_item_cache= true;
}
void reset_forced_const() { const_item_cache= false; }
- virtual bool const_during_execution() const { return false; }
- virtual void print(String *str, enum_query_type query_type);
+ bool const_during_execution() const override { return false; }
+ void print(String *str, enum_query_type query_type) override;
void fix_num_length_and_dec();
/**
@@ -510,7 +510,7 @@ public:
may be initialized to 0 by clear() and to NULL by
no_rows_in_result().
*/
- virtual void no_rows_in_result()
+ void no_rows_in_result() override
{
set_aggregator(current_thd, with_distinct ?
Aggregator::DISTINCT_AGGREGATOR :
@@ -518,14 +518,14 @@ public:
aggregator_clear();
}
virtual void make_unique() { force_copy_fields= TRUE; }
- Item *get_tmp_table_item(THD *thd);
+ Item *get_tmp_table_item(THD *thd) override;
virtual Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
return create_tmp_field(root, param->group(), table);
}
- virtual bool collect_outer_ref_processor(void *param);
+ bool collect_outer_ref_processor(void *param) override;
bool init_sum_func_check(THD *thd);
bool check_sum_func(THD *thd, Item **ref);
bool register_sum_func(THD *thd, Item **ref);
@@ -585,8 +585,8 @@ public:
virtual bool supports_removal() const { return false; }
virtual void remove() { DBUG_ASSERT(0); }
- virtual void cleanup();
- bool check_vcol_func_processor(void *arg);
+ void cleanup() override;
+ bool check_vcol_func_processor(void *arg) override;
virtual void setup_window_func(THD *thd, Window_spec *window_spec) {}
void mark_as_window_func_sum_expr() { window_func_sum_expr_flag= true; }
bool is_window_func_sum_expr() { return window_func_sum_expr_flag; }
@@ -748,23 +748,24 @@ public:
Item_sum_double(THD *thd, Item *item_par): Item_sum_num(thd, item_par) {}
Item_sum_double(THD *thd, List<Item> &list): Item_sum_num(thd, list) {}
Item_sum_double(THD *thd, Item_sum_double *item) :Item_sum_num(thd, item) {}
- longlong val_int()
+ longlong val_int() override
{
return val_int_from_real();
}
- String *val_str(String*str)
+ String *val_str(String*str) override
{
return val_string_from_real(str);
}
- my_decimal *val_decimal(my_decimal *to)
+ my_decimal *val_decimal(my_decimal *to) override
{
return val_decimal_from_real(to);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return get_date_from_real(thd, ltime, fuzzydate);
}
- const Type_handler *type_handler() const { return &type_handler_double; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
};
@@ -775,14 +776,14 @@ public:
Item_sum_int(THD *thd, Item *item_par): Item_sum_num(thd, item_par) {}
Item_sum_int(THD *thd, List<Item> &list): Item_sum_num(thd, list) {}
Item_sum_int(THD *thd, Item_sum_int *item) :Item_sum_num(thd, item) {}
- double val_real() { DBUG_ASSERT(fixed()); return (double) val_int(); }
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ double val_real() override { DBUG_ASSERT(fixed()); return (double) val_int(); }
+ String *val_str(String*str) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return get_date_from_int(thd, ltime, fuzzydate);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=21;
@@ -804,7 +805,7 @@ protected:
my_decimal direct_sum_decimal;
my_decimal dec_buffs[2];
uint curr_dec_buff;
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
public:
Item_sum_sum(THD *thd, Item *item_par, bool distinct):
@@ -814,42 +815,42 @@ public:
set_distinct(distinct);
}
Item_sum_sum(THD *thd, Item_sum_sum *item);
- enum Sumfunctype sum_func () const
+ enum Sumfunctype sum_func() const override
{
return has_with_distinct() ? SUM_DISTINCT_FUNC : SUM_FUNC;
}
- void cleanup();
+ void cleanup() override;
void direct_add(my_decimal *add_sum_decimal);
void direct_add(double add_sum_real, bool add_sum_is_null);
- void clear();
- bool add();
- double val_real();
- longlong val_int();
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ void clear() override;
+ bool add() override;
+ double val_real() override;
+ longlong val_int() override;
+ String *val_str(String*str) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{ return Type_handler_hybrid_field_type::type_handler(); }
void fix_length_and_dec_double();
void fix_length_and_dec_decimal();
- void reset_field();
- void update_field();
- void no_rows_in_result() {}
+ void reset_field() override;
+ void update_field() override;
+ void no_rows_in_result() override {}
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name_distinct= { STRING_WITH_LEN("sum(distinct ")};
static LEX_CSTRING name_normal= { STRING_WITH_LEN("sum(") };
return has_with_distinct() ? name_distinct : name_normal;
}
- Item *copy_or_same(THD* thd);
- void remove();
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ void remove() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_sum>(thd, this); }
- bool supports_removal() const
+ bool supports_removal() const override
{
return true;
}
@@ -869,10 +870,10 @@ class Item_sum_count :public Item_sum_int
friend class Aggregator_distinct;
- void clear();
- bool add();
- void cleanup();
- void remove();
+ void clear() override;
+ bool add() override;
+ void cleanup() override;
+ void remove() override;
public:
Item_sum_count(THD *thd, Item *item_par):
@@ -898,20 +899,21 @@ public:
Item_sum_int(thd, item), direct_counted(FALSE),
direct_reseted_field(FALSE), count(item->count)
{}
- enum Sumfunctype sum_func () const
+ enum Sumfunctype sum_func () const override
{
return has_with_distinct() ? COUNT_DISTINCT_FUNC : COUNT_FUNC;
}
- void no_rows_in_result() { count=0; }
+ void no_rows_in_result() override { count=0; }
void make_const(longlong count_arg)
{
count=count_arg;
Item_sum::make_const();
}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
- longlong val_int();
- void reset_field();
- void update_field();
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
+ longlong val_int() override;
+ void reset_field() override;
+ void update_field() override;
void direct_add(longlong add_count);
LEX_CSTRING func_name_cstring() const override
{
@@ -919,11 +921,11 @@ public:
static LEX_CSTRING name_normal= { STRING_WITH_LEN("count(") };
return has_with_distinct() ? name_distinct : name_normal;
}
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_count>(thd, this); }
- bool supports_removal() const
+ bool supports_removal() const override
{
return true;
}
@@ -948,40 +950,40 @@ public:
void fix_length_and_dec_double();
void fix_length_and_dec_decimal();
- bool fix_length_and_dec();
- enum Sumfunctype sum_func () const
+ bool fix_length_and_dec() override;
+ enum Sumfunctype sum_func () const override
{
return has_with_distinct() ? AVG_DISTINCT_FUNC : AVG_FUNC;
}
- void clear();
- bool add();
- void remove();
- double val_real();
+ void clear() override;
+ bool add() override;
+ void remove() override;
+ double val_real() override;
// In SPs we might force the "wrong" type with select into a declare variable
- longlong val_int() { return val_int_from_real(); }
- my_decimal *val_decimal(my_decimal *);
- String *val_str(String *str);
- void reset_field();
- void update_field();
- Item *result_item(THD *thd, Field *field);
- void no_rows_in_result() {}
+ longlong val_int() override { return val_int_from_real(); }
+ my_decimal *val_decimal(my_decimal *) override;
+ String *val_str(String *str) override;
+ void reset_field() override;
+ void update_field() override;
+ Item *result_item(THD *thd, Field *field) override;
+ void no_rows_in_result() override {}
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name_distinct= { STRING_WITH_LEN("avg(distinct ")};
static LEX_CSTRING name_normal= { STRING_WITH_LEN("avg(") };
return has_with_distinct() ? name_distinct : name_normal;
}
- Item *copy_or_same(THD* thd);
- Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
- void cleanup()
+ Item *copy_or_same(THD* thd) override;
+ Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override;
+ void cleanup() override
{
count= 0;
Item_sum_sum::cleanup();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_avg>(thd, this); }
- bool supports_removal() const
+ bool supports_removal() const override
{
return true;
}
@@ -1113,7 +1115,7 @@ public:
:Item_sum(thd, item),
Type_handler_hybrid_field_type(item)
{ }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{ return Type_handler_hybrid_field_type::type_handler(); }
bool fix_length_and_dec_generic();
bool fix_length_and_dec_numeric(const Type_handler *h);
@@ -1146,35 +1148,36 @@ public:
direct_added(FALSE), value(item->value), arg_cache(0),
cmp_sign(item->cmp_sign), was_values(item->was_values)
{ }
- bool fix_fields(THD *, Item **);
- bool fix_length_and_dec();
+ bool fix_fields(THD *, Item **) override;
+ bool fix_length_and_dec() override;
void setup_hybrid(THD *thd, Item *item, Item *value_arg);
- void clear();
+ void clear() override;
void direct_add(Item *item);
- double val_real();
- longlong val_int();
- my_decimal *val_decimal(my_decimal *);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- void reset_field();
- String *val_str(String *);
- bool val_native(THD *thd, Native *);
- const Type_handler *real_type_handler() const
+ double val_real() override;
+ longlong val_int() override;
+ my_decimal *val_decimal(my_decimal *) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ void reset_field() override;
+ String *val_str(String *) override;
+ bool val_native(THD *thd, Native *) override;
+ const Type_handler *real_type_handler() const override
{
return get_arg(0)->real_type_handler();
}
- const TYPELIB *get_typelib() const { return args[0]->get_typelib(); }
- void update_field();
+ const TYPELIB *get_typelib() const override { return args[0]->get_typelib(); }
+ void update_field() override;
void min_max_update_str_field();
void min_max_update_real_field();
void min_max_update_int_field();
void min_max_update_decimal_field();
void min_max_update_native_field();
- void cleanup();
+ void cleanup() override;
bool any_value() { return was_values; }
- void no_rows_in_result();
- void restore_to_before_no_rows_in_result();
- Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
- void setup_caches(THD *thd) { setup_hybrid(thd, arguments()[0], NULL); }
+ void no_rows_in_result() override;
+ void restore_to_before_no_rows_in_result() override;
+ Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override;
+ void setup_caches(THD *thd) override
+ { setup_hybrid(thd, arguments()[0], NULL); }
};
@@ -1183,16 +1186,16 @@ class Item_sum_min final :public Item_sum_min_max
public:
Item_sum_min(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, 1) {}
Item_sum_min(THD *thd, Item_sum_min *item) :Item_sum_min_max(thd, item) {}
- enum Sumfunctype sum_func () const {return MIN_FUNC;}
+ enum Sumfunctype sum_func () const override {return MIN_FUNC;}
- bool add();
+ bool add() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING sum_name= {STRING_WITH_LEN("min(") };
return sum_name;
}
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_min>(thd, this); }
};
@@ -1202,16 +1205,16 @@ class Item_sum_max final :public Item_sum_min_max
public:
Item_sum_max(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, -1) {}
Item_sum_max(THD *thd, Item_sum_max *item) :Item_sum_min_max(thd, item) {}
- enum Sumfunctype sum_func () const {return MAX_FUNC;}
+ enum Sumfunctype sum_func () const override {return MAX_FUNC;}
- bool add();
+ bool add() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING sum_name= {STRING_WITH_LEN("max(") };
return sum_name;
}
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_max>(thd, this); }
};
@@ -1230,13 +1233,14 @@ public:
if (as_window_function)
memcpy(bit_counters, item->bit_counters, sizeof(bit_counters));
}
- enum Sumfunctype sum_func () const {return SUM_BIT_FUNC;}
- void clear();
- longlong val_int();
- void reset_field();
- void update_field();
- const Type_handler *type_handler() const { return &type_handler_ulonglong; }
- bool fix_length_and_dec()
+ enum Sumfunctype sum_func () const override { return SUM_BIT_FUNC;}
+ void clear() override;
+ longlong val_int() override;
+ void reset_field() override;
+ void update_field() override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_ulonglong; }
+ bool fix_length_and_dec() override
{
if (args[0]->check_type_can_return_int(func_name_cstring()))
return true;
@@ -1245,7 +1249,7 @@ public:
null_value= 0;
return FALSE;
}
- void cleanup()
+ void cleanup() override
{
bits= reset_bits;
if (as_window_function)
@@ -1254,11 +1258,12 @@ public:
}
void setup_window_func(THD *thd __attribute__((unused)),
Window_spec *window_spec __attribute__((unused)))
+ override
{
as_window_function= TRUE;
clear_as_window();
}
- void remove()
+ void remove() override
{
if (as_window_function)
{
@@ -1269,7 +1274,7 @@ public:
DBUG_ASSERT(0);
}
- bool supports_removal() const
+ bool supports_removal() const override
{
return true;
}
@@ -1297,18 +1302,18 @@ class Item_sum_or final :public Item_sum_bit
public:
Item_sum_or(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
Item_sum_or(THD *thd, Item_sum_or *item) :Item_sum_bit(thd, item) {}
- bool add();
+ bool add() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING sum_name= {STRING_WITH_LEN("bit_or(") };
return sum_name;
}
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_or>(thd, this); }
private:
- void set_bits_from_counters();
+ void set_bits_from_counters() override;
};
@@ -1318,18 +1323,18 @@ public:
Item_sum_and(THD *thd, Item *item_par):
Item_sum_bit(thd, item_par, ULONGLONG_MAX) {}
Item_sum_and(THD *thd, Item_sum_and *item) :Item_sum_bit(thd, item) {}
- bool add();
+ bool add() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING sum_min_name= {STRING_WITH_LEN("bit_and(") };
return sum_min_name;
}
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_and>(thd, this); }
private:
- void set_bits_from_counters();
+ void set_bits_from_counters() override;
};
class Item_sum_xor final :public Item_sum_bit
@@ -1337,18 +1342,18 @@ class Item_sum_xor final :public Item_sum_bit
public:
Item_sum_xor(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
Item_sum_xor(THD *thd, Item_sum_xor *item) :Item_sum_bit(thd, item) {}
- bool add();
+ bool add() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING sum_min_name= {STRING_WITH_LEN("bit_xor(") };
return sum_min_name;
}
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_xor>(thd, this); }
private:
- void set_bits_from_counters();
+ void set_bits_from_counters() override;
};
class sp_head;
@@ -1403,7 +1408,7 @@ struct st_sp_security_context;
Example:
DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN ret_val;
*/
-class Item_sum_sp final :public Item_sum,
+class Item_sum_sp :public Item_sum,
public Item_sp
{
private:
@@ -1417,48 +1422,48 @@ public:
sp_head *sp, List<Item> &list);
Item_sum_sp(THD *thd, Item_sum_sp *item);
- enum Sumfunctype sum_func () const
+ enum Sumfunctype sum_func () const override
{
return SP_AGGREGATE_FUNC;
}
- Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table)
+ Field *create_field_for_create_select(MEM_ROOT *root, TABLE *table) override
{
return create_table_field_from_handler(root, table);
}
- bool fix_length_and_dec();
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_length_and_dec() override;
+ bool fix_fields(THD *thd, Item **ref) override;
LEX_CSTRING func_name_cstring() const override;
- const Type_handler *type_handler() const;
- bool add();
+ const Type_handler *type_handler() const override;
+ bool add() override;
/* val_xx functions */
- longlong val_int()
+ longlong val_int() override
{
if(execute())
return 0;
return sp_result_field->val_int();
}
- double val_real()
+ double val_real() override
{
if(execute())
return 0.0;
return sp_result_field->val_real();
}
- my_decimal *val_decimal(my_decimal *dec_buf)
+ my_decimal *val_decimal(my_decimal *dec_buf) override
{
if(execute())
return NULL;
return sp_result_field->val_decimal(dec_buf);
}
- bool val_native(THD *thd, Native *to)
+ bool val_native(THD *thd, Native *to) override
{
return (null_value= execute()) || sp_result_field->val_native(to);
}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
String buf;
char buff[20];
@@ -1476,11 +1481,11 @@ public:
str->copy(buf);
return str;
}
- void reset_field(){DBUG_ASSERT(0);}
- void update_field(){DBUG_ASSERT(0);}
- void clear();
- void cleanup();
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ void reset_field() override{DBUG_ASSERT(0);}
+ void update_field() override{DBUG_ASSERT(0);}
+ void clear() override;
+ void cleanup() override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return execute() || sp_result_field->get_date(ltime, fuzzydate);
}
@@ -1488,9 +1493,9 @@ public:
{
return sp_result_field;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_sp>(thd, this); }
- Item *copy_or_same(THD *thd);
+ Item *copy_or_same(THD *thd) override;
};
/* Items to get the value of a stored sum function */
@@ -1509,18 +1514,18 @@ public:
max_length= item->max_length;
unsigned_flag= item->unsigned_flag;
}
- table_map used_tables() const { return (table_map) 1L; }
+ table_map used_tables() const override { return (table_map) 1L; }
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
return create_tmp_field_ex_simple(root, table, src, param);
}
- void save_in_result_field(bool no_conversions) { DBUG_ASSERT(0); }
- bool check_vcol_func_processor(void *arg)
+ void save_in_result_field(bool no_conversions) override { DBUG_ASSERT(0); }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(name.str, arg, VCOL_IMPOSSIBLE);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
@@ -1535,8 +1540,8 @@ public:
Item_avg_field(THD *thd, Item_sum_avg *item)
:Item_sum_field(thd, item), prec_increment(item->prec_increment)
{ }
- enum Type type() const { return FIELD_AVG_ITEM; }
- bool is_null() { update_null_value(); return null_value; }
+ enum Type type() const override { return FIELD_AVG_ITEM; }
+ bool is_null() override { update_null_value(); return null_value; }
};
@@ -1546,12 +1551,15 @@ public:
Item_avg_field_double(THD *thd, Item_sum_avg *item)
:Item_avg_field(thd, item)
{ }
- const Type_handler *type_handler() const { return &type_handler_double; }
- longlong val_int() { return val_int_from_real(); }
- my_decimal *val_decimal(my_decimal *dec) { return val_decimal_from_real(dec); }
- String *val_str(String *str) { return val_string_from_real(str); }
- double val_real();
- Item *get_copy(THD *thd)
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ longlong val_int() override { return val_int_from_real(); }
+ my_decimal *val_decimal(my_decimal *dec) override
+ { return val_decimal_from_real(dec); }
+ String *val_str(String *str) override
+ { return val_string_from_real(str); }
+ double val_real() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_avg_field_double>(thd, this); }
};
@@ -1566,21 +1574,22 @@ public:
f_scale(item->f_scale),
dec_bin_size(item->dec_bin_size)
{ }
- const Type_handler *type_handler() const { return &type_handler_newdecimal; }
- double val_real()
+ const Type_handler *type_handler() const override
+ { return &type_handler_newdecimal; }
+ double val_real() override
{
return VDec(this).to_double();
}
- longlong val_int()
+ longlong val_int() override
{
return VDec(this).to_longlong(unsigned_flag);
}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
return VDec(this).to_string_round(str, decimals);
}
- my_decimal *val_decimal(my_decimal *);
- Item *get_copy(THD *thd)
+ my_decimal *val_decimal(my_decimal *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_avg_field_decimal>(thd, this); }
};
@@ -1592,16 +1601,17 @@ public:
Item_variance_field(THD *thd, Item_sum_variance *item)
:Item_sum_field(thd, item), sample(item->sample)
{ }
- enum Type type() const {return FIELD_VARIANCE_ITEM; }
- double val_real();
- longlong val_int() { return val_int_from_real(); }
- String *val_str(String *str)
+ enum Type type() const override {return FIELD_VARIANCE_ITEM; }
+ double val_real() override;
+ longlong val_int() override { return val_int_from_real(); }
+ String *val_str(String *str) override
{ return val_string_from_real(str); }
- my_decimal *val_decimal(my_decimal *dec_buf)
+ my_decimal *val_decimal(my_decimal *dec_buf) override
{ return val_decimal_from_real(dec_buf); }
- bool is_null() { update_null_value(); return null_value; }
- const Type_handler *type_handler() const { return &type_handler_double; }
- Item *get_copy(THD *thd)
+ bool is_null() override { update_null_value(); return null_value; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_variance_field>(thd, this); }
};
@@ -1612,9 +1622,9 @@ public:
Item_std_field(THD *thd, Item_sum_std *item)
:Item_variance_field(thd, item)
{ }
- enum Type type() const { return FIELD_STD_ITEM; }
- double val_real();
- Item *get_copy(THD *thd)
+ enum Type type() const override { return FIELD_STD_ITEM; }
+ double val_real() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_std_field>(thd, this); }
};
@@ -1645,7 +1655,7 @@ public:
const char *tmp= udf.name();
return {tmp, strlen(tmp) };
}
- bool fix_fields(THD *thd, Item **ref)
+ bool fix_fields(THD *thd, Item **ref) override
{
DBUG_ASSERT(fixed() == 0);
@@ -1677,18 +1687,18 @@ public:
memcpy (orig_args, args, sizeof (Item *) * arg_count);
return check_sum_func(thd, ref);
}
- enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
+ enum Sumfunctype sum_func () const override { return UDF_SUM_FUNC; }
virtual bool have_field_update(void) const { return 0; }
- void clear();
- bool add();
- bool supports_removal() const;
- void remove();
- void reset_field() {};
- void update_field() {};
- void cleanup();
- virtual void print(String *str, enum_query_type query_type);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ void clear() override;
+ bool add() override;
+ bool supports_removal() const override;
+ void remove() override;
+ void reset_field() override {};
+ void update_field() override {}
+ void cleanup() override;
+ void print(String *str, enum_query_type query_type) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
@@ -1704,14 +1714,16 @@ class Item_sum_udf_float :public Item_udf_sum
Item_udf_sum(thd, udf_arg, list) {}
Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
:Item_udf_sum(thd, item) {}
- longlong val_int() { return val_int_from_real(); }
- double val_real();
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *);
- const Type_handler *type_handler() const { return &type_handler_double; }
- bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; }
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ longlong val_int() override { return val_int_from_real(); }
+ double val_real() override;
+ String *val_str(String*str) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ bool fix_length_and_dec() override
+ { fix_num_length_and_dec(); return FALSE; }
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_udf_float>(thd, this); }
};
@@ -1725,20 +1737,20 @@ public:
Item_udf_sum(thd, udf_arg, list) {}
Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
:Item_udf_sum(thd, item) {}
- longlong val_int();
- double val_real()
+ longlong val_int() override;
+ double val_real() override
{ DBUG_ASSERT(fixed()); return (double) Item_sum_udf_int::val_int(); }
- String *val_str(String*str);
- my_decimal *val_decimal(my_decimal *);
- const Type_handler *type_handler() const
+ String *val_str(String*str) override;
+ my_decimal *val_decimal(my_decimal *) override;
+ const Type_handler *type_handler() const override
{
if (unsigned_flag)
return &type_handler_ulonglong;
return &type_handler_slonglong;
}
- bool fix_length_and_dec() { decimals=0; max_length=21; return FALSE; }
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override { decimals=0; max_length=21; return FALSE; }
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_udf_int>(thd, this); }
};
@@ -1752,8 +1764,8 @@ public:
Item_udf_sum(thd, udf_arg, list) {}
Item_sum_udf_str(THD *thd, Item_sum_udf_str *item)
:Item_udf_sum(thd, item) {}
- String *val_str(String *);
- double val_real()
+ String *val_str(String *) override;
+ double val_real() override
{
int err_not_used;
char *end_not_used;
@@ -1762,7 +1774,7 @@ public:
return res ? res->charset()->strntod((char*) res->ptr(),res->length(),
&end_not_used, &err_not_used) : 0.0;
}
- longlong val_int()
+ longlong val_int() override
{
int err_not_used;
char *end;
@@ -1775,11 +1787,12 @@ public:
end= (char*) res->ptr()+res->length();
return cs->strtoll10(res->ptr(), &end, &err_not_used);
}
- my_decimal *val_decimal(my_decimal *dec);
- const Type_handler *type_handler() const { return string_type_handler(); }
- bool fix_length_and_dec();
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ my_decimal *val_decimal(my_decimal *dec) override;
+ const Type_handler *type_handler() const override
+ { return string_type_handler(); }
+ bool fix_length_and_dec() override;
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_udf_str>(thd, this); }
};
@@ -1793,23 +1806,25 @@ public:
Item_udf_sum(thd, udf_arg, list) {}
Item_sum_udf_decimal(THD *thd, Item_sum_udf_decimal *item)
:Item_udf_sum(thd, item) {}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
return VDec(this).to_string_round(str, decimals);
}
- double val_real()
+ double val_real() override
{
return VDec(this).to_double();
}
- longlong val_int()
+ longlong val_int() override
{
return VDec(this).to_longlong(unsigned_flag);
}
- my_decimal *val_decimal(my_decimal *);
- const Type_handler *type_handler() const { return &type_handler_newdecimal; }
- bool fix_length_and_dec() { fix_num_length_and_dec(); return FALSE; }
- Item *copy_or_same(THD* thd);
- Item *get_copy(THD *thd)
+ my_decimal *val_decimal(my_decimal *) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_newdecimal; }
+ bool fix_length_and_dec() override
+ { fix_num_length_and_dec(); return FALSE; }
+ Item *copy_or_same(THD* thd) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_udf_decimal>(thd, this); }
};
@@ -2008,31 +2023,31 @@ public:
Item_func_group_concat(THD *thd, Item_func_group_concat *item);
~Item_func_group_concat();
- void cleanup();
+ void cleanup() override;
- enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
+ enum Sumfunctype sum_func () const override {return GROUP_CONCAT_FUNC;}
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING sum_name= {STRING_WITH_LEN("group_concat(") };
return sum_name;
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
if (too_big_for_varchar())
return &type_handler_blob;
return &type_handler_varchar;
}
- void clear();
- bool add()
+ void clear() override;
+ bool add() override
{
return add(skip_nulls());
}
- void reset_field() { DBUG_ASSERT(0); } // not used
- void update_field() { DBUG_ASSERT(0); } // not used
- bool fix_fields(THD *,Item **);
- bool setup(THD *thd);
- void make_unique();
- double val_real()
+ void reset_field() override { DBUG_ASSERT(0); } // not used
+ void update_field() override { DBUG_ASSERT(0); } // not used
+ bool fix_fields(THD *,Item **) override;
+ bool setup(THD *thd) override;
+ void make_unique() override;
+ double val_real() override
{
int error;
const char *end;
@@ -2042,7 +2057,7 @@ public:
end= res->ptr() + res->length();
return (my_strtod(res->ptr(), (char**) &end, &error));
}
- longlong val_int()
+ longlong val_int() override
{
String *res;
char *end_ptr;
@@ -2052,21 +2067,21 @@ public:
end_ptr= (char*) res->ptr()+ res->length();
return my_strtoll10(res->ptr(), &end_ptr, &error);
}
- my_decimal *val_decimal(my_decimal *decimal_value)
+ my_decimal *val_decimal(my_decimal *decimal_value) override
{
return val_decimal_from_string(decimal_value);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return get_date_from_string(thd, ltime, fuzzydate);
}
- String* val_str(String* str);
- Item *copy_or_same(THD* thd);
- void no_rows_in_result() {}
- void print(String *str, enum_query_type query_type);
- bool change_context_processor(void *cntx)
+ String *val_str(String *str) override;
+ Item *copy_or_same(THD* thd) override;
+ void no_rows_in_result() override {}
+ void print(String *str, enum_query_type query_type) override;
+ bool change_context_processor(void *cntx) override
{ context= (Name_resolution_context *)cntx; return FALSE; }
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_group_concat>(thd, this); }
qsort_cmp2 get_comparator_function_for_distinct();
qsort_cmp2 get_comparator_function_for_order_by();
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 892eb42c558..af266956b05 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -32,7 +32,7 @@ bool get_interval_value(THD *thd, Item *args,
class Item_long_func_date_field: public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_date(func_name_cstring()); }
public:
Item_long_func_date_field(THD *thd, Item *a)
@@ -42,7 +42,7 @@ public:
class Item_long_func_time_field: public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_time(func_name_cstring()); }
public:
Item_long_func_time_field(THD *thd, Item *a)
@@ -52,45 +52,45 @@ public:
class Item_func_period_add :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_int(0, 2); }
public:
Item_func_period_add(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("period_add") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_period_add>(thd, this); }
};
class Item_func_period_diff :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_int(0, 2); }
public:
Item_func_period_diff(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("period_diff") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
return FALSE;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_period_diff>(thd, this); }
};
@@ -99,61 +99,61 @@ class Item_func_to_days :public Item_long_func_date_field
{
public:
Item_func_to_days(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("to_days") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- enum_monotonicity_info get_monotonicity_info() const;
- longlong val_int_endpoint(bool left_endp, bool *incl_endp);
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ enum_monotonicity_info get_monotonicity_info() const override;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_to_days>(thd, this); }
};
class Item_func_to_seconds :public Item_longlong_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_date(0, arg_count); }
public:
Item_func_to_seconds(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("to_seconds") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
fix_char_length(12);
set_maybe_null();
return FALSE;
}
- enum_monotonicity_info get_monotonicity_info() const;
- longlong val_int_endpoint(bool left_endp, bool *incl_endp);
- bool check_partition_func_processor(void *bool_arg) { return FALSE;}
+ enum_monotonicity_info get_monotonicity_info() const override;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
+ bool check_partition_func_processor(void *bool_arg) override { return FALSE;}
/* Only meaningful with date part and optional time part */
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_to_seconds>(thd, this); }
};
@@ -162,26 +162,26 @@ class Item_func_dayofmonth :public Item_long_func_date_field
{
public:
Item_func_dayofmonth(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("dayofmonth") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dayofmonth>(thd, this); }
};
@@ -191,26 +191,26 @@ class Item_func_month :public Item_long_func
public:
Item_func_month(THD *thd, Item *a): Item_long_func(thd, a)
{ }
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("month") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= 0;
fix_char_length(2);
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_month>(thd, this); }
};
@@ -225,18 +225,18 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("monthname") };
return name;
}
- String *val_str(String *str);
- bool fix_length_and_dec();
- bool check_partition_func_processor(void *int_arg) {return TRUE;}
- bool check_valid_arguments_processor(void *int_arg)
+ String *val_str(String *str) override;
+ bool fix_length_and_dec() override;
+ bool check_partition_func_processor(void *int_arg) override {return TRUE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_monthname>(thd, this); }
};
@@ -245,26 +245,26 @@ class Item_func_dayofyear :public Item_long_func_date_field
{
public:
Item_func_dayofyear(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("dayofyear") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= 0;
fix_char_length(3);
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dayofyear>(thd, this); }
};
@@ -273,26 +273,26 @@ class Item_func_hour :public Item_long_func_time_field
{
public:
Item_func_hour(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("hour") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_time_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_hour>(thd, this); }
};
@@ -301,26 +301,26 @@ class Item_func_minute :public Item_long_func_time_field
{
public:
Item_func_minute(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("minute") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_time_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_minute>(thd, this); }
};
@@ -329,26 +329,26 @@ class Item_func_quarter :public Item_long_func_date_field
{
public:
Item_func_quarter(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("quarter") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=1*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_quarter>(thd, this); }
};
@@ -357,33 +357,33 @@ class Item_func_second :public Item_long_func_time_field
{
public:
Item_func_second(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("second") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_time_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_second>(thd, this); }
};
class Item_func_week :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_date(func_name_cstring()) ||
(arg_count > 1 && args[1]->check_type_can_return_int(func_name_cstring()));
@@ -391,36 +391,36 @@ class Item_func_week :public Item_long_func
public:
Item_func_week(THD *thd, Item *a): Item_long_func(thd, a) {}
Item_func_week(THD *thd, Item *a, Item *b): Item_long_func(thd, a, b) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("week") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=2*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
if (arg_count == 2)
return FALSE;
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_valid_arguments_processor(void *int_arg) override
{
return arg_count == 2;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_week>(thd, this); }
};
class Item_func_yearweek :public Item_long_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_date(func_name_cstring()) ||
args[1]->check_type_can_return_int(func_name_cstring());
@@ -428,26 +428,26 @@ class Item_func_yearweek :public Item_long_func
public:
Item_func_yearweek(THD *thd, Item *a, Item *b)
:Item_long_func(thd, a, b) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("yearweek") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=6*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_yearweek>(thd, this); }
};
@@ -456,28 +456,28 @@ class Item_func_year :public Item_long_func_date_field
{
public:
Item_func_year(THD *thd, Item *a): Item_long_func_date_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("year") };
return name;
}
- enum_monotonicity_info get_monotonicity_info() const;
- longlong val_int_endpoint(bool left_endp, bool *incl_endp);
- bool fix_length_and_dec()
+ enum_monotonicity_info get_monotonicity_info() const override;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
+ bool fix_length_and_dec() override
{
decimals=0;
max_length=4*MY_CHARSET_BIN_MB_MAXLEN;
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_year>(thd, this); }
};
@@ -488,31 +488,31 @@ class Item_func_weekday :public Item_long_func
public:
Item_func_weekday(THD *thd, Item *a, bool type_arg):
Item_long_func(thd, a), odbc_type(type_arg) { }
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING dayofweek= {STRING_WITH_LEN("dayofweek") };
static LEX_CSTRING weekday= {STRING_WITH_LEN("weekday") };
return (odbc_type ? dayofweek : weekday);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals= 0;
fix_char_length(1);
set_maybe_null();
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_weekday>(thd, this); }
};
@@ -526,19 +526,20 @@ class Item_func_dayname :public Item_str_func
static LEX_CSTRING name= {STRING_WITH_LEN("dayname") };
return name;
}
- String *val_str(String *str);
- const Type_handler *type_handler() const { return &type_handler_varchar; }
- bool fix_length_and_dec();
- bool check_partition_func_processor(void *int_arg) {return TRUE;}
- bool check_vcol_func_processor(void *arg)
+ String *val_str(String *str) override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_varchar; }
+ bool fix_length_and_dec() override;
+ bool check_partition_func_processor(void *int_arg) override {return TRUE;}
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_date_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_dayname>(thd, this); }
};
@@ -581,33 +582,33 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("unix_timestamp") };
return name;
}
- enum_monotonicity_info get_monotonicity_info() const;
- longlong val_int_endpoint(bool left_endp, bool *incl_endp);
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
+ enum_monotonicity_info get_monotonicity_info() const override;
+ longlong val_int_endpoint(bool left_endp, bool *incl_endp) override;
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
/*
UNIX_TIMESTAMP() depends on the current timezone
(and thus may not be used as a partitioning function)
when its argument is NOT of the TIMESTAMP type.
*/
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_timestamp_args();
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
if (arg_count)
return FALSE;
return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
fix_length_and_dec_generic(arg_count ?
args[0]->datetime_precision(current_thd) : 0);
return FALSE;
}
- longlong int_op();
- my_decimal *decimal_op(my_decimal* buf);
- Item *get_copy(THD *thd)
+ longlong int_op() override;
+ my_decimal *decimal_op(my_decimal* buf) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_unix_timestamp>(thd, this); }
};
@@ -622,20 +623,20 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("time_to_sec") };
return name;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_time_args();
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
fix_length_and_dec_generic(args[0]->time_precision(current_thd));
return FALSE;
}
- longlong int_op();
- my_decimal *decimal_op(my_decimal* buf);
- Item *get_copy(THD *thd)
+ longlong int_op() override;
+ my_decimal *decimal_op(my_decimal* buf) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_time_to_sec>(thd, this); }
};
@@ -646,12 +647,17 @@ public:
Item_datefunc(THD *thd): Item_func(thd) { }
Item_datefunc(THD *thd, Item *a): Item_func(thd, a) { }
Item_datefunc(THD *thd, Item *a, Item *b): Item_func(thd, a, b) { }
- const Type_handler *type_handler() const { return &type_handler_newdate; }
- longlong val_int() { return Date(this).to_longlong(); }
- double val_real() { return Date(this).to_double(); }
- String *val_str(String *to) { return Date(this).to_string(to); }
- my_decimal *val_decimal(my_decimal *to) { return Date(this).to_decimal(to); }
- bool fix_length_and_dec()
+ const Type_handler *type_handler() const override
+ { return &type_handler_newdate; }
+ longlong val_int() override
+ { return Date(this).to_longlong(); }
+ double val_real() override
+ { return Date(this).to_double(); }
+ String *val_str(String *to) override
+ { return Date(this).to_string(to); }
+ my_decimal *val_decimal(my_decimal *to) override
+ { return Date(this).to_decimal(to); }
+ bool fix_length_and_dec() override
{
fix_attributes_date();
set_maybe_null(arg_count > 0);
@@ -667,15 +673,18 @@ public:
Item_timefunc(THD *thd, Item *a): Item_func(thd, a) {}
Item_timefunc(THD *thd, Item *a, Item *b): Item_func(thd, a, b) {}
Item_timefunc(THD *thd, Item *a, Item *b, Item *c): Item_func(thd, a, b ,c) {}
- const Type_handler *type_handler() const { return &type_handler_time2; }
- longlong val_int() { return Time(this).to_longlong(); }
- double val_real() { return Time(this).to_double(); }
- String *val_str(String *to) { return Time(this).to_string(to, decimals); }
- my_decimal *val_decimal(my_decimal *to) { return Time(this).to_decimal(to); }
- bool val_native(THD *thd, Native *to)
- {
- return Time(thd, this).to_native(to, decimals);
- }
+ const Type_handler *type_handler() const override
+ { return &type_handler_time2; }
+ longlong val_int() override
+ { return Time(this).to_longlong(); }
+ double val_real() override
+ { return Time(this).to_double(); }
+ String *val_str(String *to) override
+ { return Time(this).to_string(to, decimals); }
+ my_decimal *val_decimal(my_decimal *to) override
+ { return Time(this).to_decimal(to); }
+ bool val_native(THD *thd, Native *to) override
+ { return Time(thd, this).to_native(to, decimals); }
};
@@ -687,11 +696,14 @@ public:
Item_datetimefunc(THD *thd, Item *a, Item *b): Item_func(thd, a, b) {}
Item_datetimefunc(THD *thd, Item *a, Item *b, Item *c):
Item_func(thd, a, b ,c) {}
- const Type_handler *type_handler() const { return &type_handler_datetime2; }
- longlong val_int() { return Datetime(this).to_longlong(); }
- double val_real() { return Datetime(this).to_double(); }
- String *val_str(String *to) { return Datetime(this).to_string(to, decimals); }
- my_decimal *val_decimal(my_decimal *to) { return Datetime(this).to_decimal(to); }
+ const Type_handler *type_handler() const override
+ { return &type_handler_datetime2; }
+ longlong val_int() override { return Datetime(this).to_longlong(); }
+ double val_real() override { return Datetime(this).to_double(); }
+ String *val_str(String *to) override
+ { return Datetime(this).to_string(to, decimals); }
+ my_decimal *val_decimal(my_decimal *to) override
+ { return Datetime(this).to_decimal(to); }
};
@@ -704,20 +716,21 @@ class Item_func_curtime :public Item_timefunc
public:
Item_func_curtime(THD *thd, uint dec): Item_timefunc(thd), last_query_id(0)
{ decimals= dec; }
- bool fix_fields(THD *, Item **);
- bool fix_length_and_dec() { fix_attributes_time(decimals); return FALSE; }
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
+ bool fix_fields(THD *, Item **) override;
+ bool fix_length_and_dec() override
+ { fix_attributes_time(decimals); return FALSE; }
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
/*
Abstract method that defines which time zone is used for conversion.
Converts time current time in my_time_t representation to broken-down
MYSQL_TIME representation using UTC-SYSTEM or per-thread time zone.
*/
virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
}
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
};
@@ -730,8 +743,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("curtime") };
return name;
}
- virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time);
- Item *get_copy(THD *thd)
+ void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_curtime_local>(thd, this); }
};
@@ -745,8 +758,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("utc_time") };
return name;
}
- virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time);
- Item *get_copy(THD *thd)
+ void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_curtime_utc>(thd, this); }
};
@@ -759,9 +772,9 @@ class Item_func_curdate :public Item_datefunc
MYSQL_TIME ltime;
public:
Item_func_curdate(THD *thd): Item_datefunc(thd), last_query_id(0) {}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
}
@@ -777,8 +790,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("curdate") };
return name;
}
- void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time);
- Item *get_copy(THD *thd)
+ void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_curdate_local>(thd, this); }
};
@@ -792,8 +805,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("utc_date") };
return name;
}
- void store_now_in_TIME(THD* thd, MYSQL_TIME *now_time);
- Item *get_copy(THD *thd)
+ void store_now_in_TIME(THD* thd, MYSQL_TIME *now_time) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_curdate_utc>(thd, this); }
};
@@ -807,12 +820,12 @@ class Item_func_now :public Item_datetimefunc
public:
Item_func_now(THD *thd, uint dec): Item_datetimefunc(thd), last_query_id(0)
{ decimals= dec; }
- bool fix_fields(THD *, Item **);
- bool fix_length_and_dec()
+ bool fix_fields(THD *, Item **) override;
+ bool fix_length_and_dec() override
{ fix_attributes_datetime(decimals); return FALSE;}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time)=0;
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
/*
NOW is safe for replication as slaves will run with same time as
@@ -820,7 +833,7 @@ public:
*/
return mark_unsupported_function(func_name(), "()", arg, VCOL_TIME_FUNC);
}
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
};
@@ -833,10 +846,10 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("current_timestamp") };
return name;
}
- int save_in_field(Field *field, bool no_conversions);
- virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time);
- virtual enum Functype functype() const { return NOW_FUNC; }
- Item *get_copy(THD *thd)
+ int save_in_field(Field *field, bool no_conversions) override;
+ void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
+ enum Functype functype() const override { return NOW_FUNC; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_now_local>(thd, this); }
};
@@ -850,14 +863,14 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("utc_timestamp") };
return name;
}
- virtual void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time);
- virtual enum Functype functype() const { return NOW_UTC_FUNC; }
- virtual bool check_vcol_func_processor(void *arg)
+ void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
+ enum Functype functype() const override { return NOW_UTC_FUNC; }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_TIME_FUNC | VCOL_NON_DETERMINISTIC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_now_utc>(thd, this); }
};
@@ -870,29 +883,29 @@ class Item_func_sysdate_local :public Item_func_now
{
public:
Item_func_sysdate_local(THD *thd, uint dec): Item_func_now(thd, dec) {}
- bool const_item() const { return 0; }
+ bool const_item() const override { return 0; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("sysdate") };
return name;
}
- void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time);
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- table_map used_tables() const { return RAND_TABLE_BIT; }
- bool check_vcol_func_processor(void *arg)
+ void store_now_in_TIME(THD *thd, MYSQL_TIME *now_time) override;
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ table_map used_tables() const override { return RAND_TABLE_BIT; }
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg,
VCOL_TIME_FUNC | VCOL_NON_DETERMINISTIC);
}
- virtual enum Functype functype() const { return SYSDATE_FUNC; }
- Item *get_copy(THD *thd)
+ enum Functype functype() const override { return SYSDATE_FUNC; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sysdate_local>(thd, this); }
};
class Item_func_from_days :public Item_datefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_int(func_name_cstring()); }
public:
Item_func_from_days(THD *thd, Item *a): Item_datefunc(thd, a) {}
@@ -901,21 +914,21 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("from_days") };
return name;
}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return has_date_args() || has_time_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_from_days>(thd, this); }
};
class Item_func_date_format :public Item_str_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_date(func_name_cstring()) ||
check_argument_types_can_return_text(1, arg_count);
@@ -930,22 +943,22 @@ public:
Item_str_func(thd, a, b), locale(0), is_time_format(false) {}
Item_func_date_format(THD *thd, Item *a, Item *b, Item *c):
Item_str_func(thd, a, b, c), locale(0), is_time_format(false) {}
- 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("date_format") };
return name;
}
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
uint format_length(const String *format);
- bool eq(const Item *item, bool binary_cmp) const;
- bool check_vcol_func_processor(void *arg)
+ bool eq(const Item *item, bool binary_cmp) const override;
+ bool check_vcol_func_processor(void *arg) override
{
if (arg_count > 2)
return false;
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_date_format>(thd, this); }
};
@@ -959,15 +972,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("time_format") };
return name;
}
- bool check_vcol_func_processor(void *arg) { return false; }
- Item *get_copy(THD *thd)
+ bool check_vcol_func_processor(void *arg) override { return false; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_time_format>(thd, this); }
};
class Item_func_from_unixtime :public Item_datetimefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_decimal(func_name_cstring()); }
Time_zone *tz;
public:
@@ -977,13 +990,13 @@ class Item_func_from_unixtime :public Item_datetimefunc
static LEX_CSTRING name= {STRING_WITH_LEN("from_unixtime") };
return name;
}
- bool fix_length_and_dec();
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- bool check_vcol_func_processor(void *arg)
+ bool fix_length_and_dec() override;
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_from_unixtime>(thd, this); }
};
@@ -1004,7 +1017,7 @@ class Time_zone;
*/
class Item_func_convert_tz :public Item_datetimefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_date(func_name_cstring()) ||
check_argument_types_can_return_text(1, arg_count);
@@ -1025,27 +1038,27 @@ class Item_func_convert_tz :public Item_datetimefunc
static LEX_CSTRING name= {STRING_WITH_LEN("convert_tz") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
fix_attributes_datetime(args[0]->datetime_precision(current_thd));
set_maybe_null();
return FALSE;
}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- void cleanup();
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ void cleanup() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_convert_tz>(thd, this); }
};
class Item_func_sec_to_time :public Item_timefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_decimal(func_name_cstring()); }
public:
Item_func_sec_to_time(THD *thd, Item *item): Item_timefunc(thd, item) {}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- bool fix_length_and_dec()
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ bool fix_length_and_dec() override
{
fix_attributes_time(args[0]->decimals);
set_maybe_null();
@@ -1056,7 +1069,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("sec_to_time") };
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sec_to_time>(thd, this); }
};
@@ -1075,12 +1088,12 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("date_add_interval") };
return name;
}
- bool fix_length_and_dec();
- bool eq(const Item *item, bool binary_cmp) const;
- void print(String *str, enum_query_type query_type);
- enum precedence precedence() const { return INTERVAL_PRECEDENCE; }
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ bool eq(const Item *item, bool binary_cmp) const override;
+ void print(String *str, enum_query_type query_type) override;
+ enum precedence precedence() const override { return INTERVAL_PRECEDENCE; }
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_date_add_interval>(thd, this); }
};
@@ -1129,29 +1142,29 @@ class Item_extract :public Item_int_func,
m_date_mode(date_mode_t(0)),
int_type(type_arg)
{ }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return Type_handler_hybrid_field_type::type_handler();
}
- longlong val_int();
- enum Functype functype() const { return EXTRACT_FUNC; }
+ longlong val_int() override;
+ enum Functype functype() const override { return EXTRACT_FUNC; }
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("extract") };
return name;
}
- bool check_arguments() const;
- bool fix_length_and_dec();
- bool eq(const Item *item, bool binary_cmp) const;
- void print(String *str, enum_query_type query_type);
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg)
+ bool check_arguments() const override;
+ bool fix_length_and_dec() override;
+ bool eq(const Item *item, bool binary_cmp) const override;
+ void print(String *str, enum_query_type query_type) override;
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override
{
if (int_type != INTERVAL_WEEK)
return FALSE;
return mark_unsupported_function(func_name(), "()", arg, VCOL_SESSION_FUNC);
}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_valid_arguments_processor(void *int_arg) override
{
switch (int_type) {
case INTERVAL_YEAR:
@@ -1187,7 +1200,7 @@ class Item_extract :public Item_int_func,
}
return true;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_extract>(thd, this); }
};
@@ -1214,8 +1227,8 @@ public:
Item_char_typecast(THD *thd, Item *a, uint length_arg, CHARSET_INFO *cs_arg):
Item_handled_func(thd, a), cast_length(length_arg), cast_cs(cs_arg),
m_suppress_warning_to_error_escalation(false) {}
- enum Functype functype() const { return CHAR_TYPECAST_FUNC; }
- bool eq(const Item *item, bool binary_cmp) const;
+ enum Functype functype() const override { return CHAR_TYPECAST_FUNC; }
+ bool eq(const Item *item, bool binary_cmp) const override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_char") };
@@ -1228,13 +1241,13 @@ public:
void fix_length_and_dec_numeric();
void fix_length_and_dec_str();
void fix_length_and_dec_native_to_binary(uint32 octet_length);
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
return args[0]->type_handler()->Item_char_typecast_fix_length_and_dec(this);
}
- void print(String *str, enum_query_type query_type);
- bool need_parentheses_in_default() { return true; }
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ bool need_parentheses_in_default() override { return true; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_char_typecast>(thd, this); }
};
@@ -1266,16 +1279,16 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_date") };
return name;
}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
print_cast_temporal(str, query_type);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool fix_length_and_dec()
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool fix_length_and_dec() override
{
return args[0]->type_handler()->Item_date_typecast_fix_length_and_dec(this);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_date_typecast>(thd, this); }
};
@@ -1290,18 +1303,18 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_time") };
return name;
}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
print_cast_temporal(str, query_type);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool fix_length_and_dec()
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool fix_length_and_dec() override
{
return args[0]->type_handler()->
Item_time_typecast_fix_length_and_dec(this);
}
- Sql_mode_dependency value_depends_on_sql_mode() const;
- Item *get_copy(THD *thd)
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_time_typecast>(thd, this); }
};
@@ -1316,25 +1329,25 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("cast_as_datetime") };
return name;
}
- void print(String *str, enum_query_type query_type)
+ void print(String *str, enum_query_type query_type) override
{
print_cast_temporal(str, query_type);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- bool fix_length_and_dec()
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ bool fix_length_and_dec() override
{
return args[0]->type_handler()->
Item_datetime_typecast_fix_length_and_dec(this);
}
- Sql_mode_dependency value_depends_on_sql_mode() const;
- Item *get_copy(THD *thd)
+ Sql_mode_dependency value_depends_on_sql_mode() const override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_datetime_typecast>(thd, this); }
};
class Item_func_makedate :public Item_datefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_int(0, arg_count); }
public:
Item_func_makedate(THD *thd, Item *a, Item *b):
@@ -1344,15 +1357,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("makedate") };
return name;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_makedate>(thd, this); }
};
class Item_func_timestamp :public Item_datetimefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return args[0]->check_type_can_return_date(func_name_cstring()) ||
args[1]->check_type_can_return_time(func_name_cstring());
@@ -1366,7 +1379,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("timestamp") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
THD *thd= current_thd;
uint dec0= args[0]->datetime_precision(thd);
@@ -1375,7 +1388,7 @@ public:
set_maybe_null();
return false;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
Datetime dt(thd, args[0], Datetime::Options(TIME_CONV_NONE, thd));
if (!dt.is_valid_datetime())
@@ -1387,7 +1400,7 @@ public:
return (null_value= Sec6_add(dt.get_mysql_time(), it.get_mysql_time(), 1).
to_datetime(ltime));
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_timestamp>(thd, this); }
};
@@ -1412,21 +1425,21 @@ public:
Item_func_add_time(THD *thd, Item *a, Item *b, bool neg_arg)
:Item_handled_func(thd, a, b), sign(neg_arg ? -1 : 1)
{ }
- bool fix_length_and_dec();
+ bool fix_length_and_dec() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING addtime= { STRING_WITH_LEN("addtime") };
static LEX_CSTRING subtime= { STRING_WITH_LEN("subtime") };
return sign > 0 ? addtime : subtime;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_add_time>(thd, this); }
};
class Item_func_timediff :public Item_timefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_time(0, arg_count); }
public:
Item_func_timediff(THD *thd, Item *a, Item *b): Item_timefunc(thd, a, b) {}
@@ -1435,7 +1448,7 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("timediff") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
THD *thd= current_thd;
uint dec= MY_MAX(args[0]->time_precision(thd),
@@ -1444,14 +1457,14 @@ public:
set_maybe_null();
return FALSE;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_timediff>(thd, this); }
};
class Item_func_maketime :public Item_timefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{
return check_argument_types_can_return_int(0, 2) ||
args[2]->check_type_can_return_decimal(func_name_cstring());
@@ -1460,7 +1473,7 @@ public:
Item_func_maketime(THD *thd, Item *a, Item *b, Item *c):
Item_timefunc(thd, a, b, c)
{}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
fix_attributes_time(args[2]->decimals);
set_maybe_null();
@@ -1471,8 +1484,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("maketime") };
return name;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_maketime>(thd, this); }
};
@@ -1481,33 +1494,33 @@ class Item_func_microsecond :public Item_long_func_time_field
{
public:
Item_func_microsecond(THD *thd, Item *a): Item_long_func_time_field(thd, a) {}
- longlong val_int();
+ longlong val_int() override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("microsecond") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals=0;
set_maybe_null();
fix_char_length(6);
return FALSE;
}
- bool check_partition_func_processor(void *int_arg) {return FALSE;}
- bool check_vcol_func_processor(void *arg) { return FALSE;}
- bool check_valid_arguments_processor(void *int_arg)
+ bool check_partition_func_processor(void *int_arg) override {return FALSE;}
+ bool check_vcol_func_processor(void *arg) override { return FALSE;}
+ bool check_valid_arguments_processor(void *int_arg) override
{
return !has_time_args();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_microsecond>(thd, this); }
};
class Item_func_timestamp_diff :public Item_longlong_func
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return check_argument_types_can_return_date(0, arg_count); }
const interval_type int_type;
public:
@@ -1521,15 +1534,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("timestampdiff") };
return name;
}
- longlong val_int();
- bool fix_length_and_dec()
+ longlong val_int() override;
+ bool fix_length_and_dec() override
{
decimals=0;
set_maybe_null();
return FALSE;
}
- virtual void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_timestamp_diff>(thd, this); }
};
@@ -1546,21 +1559,21 @@ public:
Item_func_get_format(THD *thd, timestamp_type type_arg, Item *a):
Item_str_ascii_func(thd, a), type(type_arg)
{}
- String *val_str_ascii(String *str);
+ String *val_str_ascii(String *str) override;
LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("get_format") };
return name;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
set_maybe_null();
decimals=0;
fix_length_and_charset(17, default_charset());
return FALSE;
}
- virtual void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_get_format>(thd, this); }
};
@@ -1583,15 +1596,15 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("str_to_date") };
return name;
}
- bool fix_length_and_dec();
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_str_to_date>(thd, this); }
};
class Item_func_last_day :public Item_datefunc
{
- bool check_arguments() const
+ bool check_arguments() const override
{ return args[0]->check_type_can_return_date(func_name_cstring()); }
public:
Item_func_last_day(THD *thd, Item *a): Item_datefunc(thd, a) {}
@@ -1600,8 +1613,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("last_day") };
return name;
}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_last_day>(thd, this); }
};
diff --git a/sql/item_vers.h b/sql/item_vers.h
index 177336775c5..e816b3bf0e9 100644
--- a/sql/item_vers.h
+++ b/sql/item_vers.h
@@ -33,12 +33,9 @@ public:
DBUG_ASSERT(a->type() == Item::FIELD_ITEM);
}
- virtual bool val_bool();
- virtual longlong val_int()
- {
- return (val_bool() ? 1 : 0);
- }
- bool fix_length_and_dec()
+ bool val_bool() override;
+ longlong val_int() override { return val_bool(); }
+ bool fix_length_and_dec() override
{
set_maybe_null();
null_value= 0;
@@ -46,13 +43,13 @@ public:
max_length= 1;
return FALSE;
}
- virtual LEX_CSTRING func_name_cstring() const override
+ LEX_CSTRING func_name_cstring() const override
{
static LEX_CSTRING name= {STRING_WITH_LEN("is_history") };
return name;
}
- virtual void print(String *str, enum_query_type query_type);
- Item *get_copy(THD *thd)
+ void print(String *str, enum_query_type query_type) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_history>(thd, this); }
};
@@ -67,10 +64,10 @@ public:
static LEX_CSTRING commit_name= {STRING_WITH_LEN("trt_commit_ts") };
return (trt_field == TR_table::FLD_BEGIN_TS) ? begin_name : commit_name;
}
- bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate);
- Item *get_copy(THD *thd)
+ bool get_date(THD *thd, MYSQL_TIME *res, date_mode_t fuzzydate) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trt_ts>(thd, this); }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{ fix_attributes_datetime(decimals); return FALSE; }
};
@@ -105,15 +102,15 @@ public:
return NULL_clex_str;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
bool res= Item_int_func::fix_length_and_dec();
max_length= 20;
return res;
}
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trt_id>(thd, this); }
};
@@ -129,8 +126,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("trt_trx_sees") };
return name;
}
- longlong val_int();
- Item *get_copy(THD *thd)
+ longlong val_int() override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trt_trx_sees>(thd, this); }
};
diff --git a/sql/item_windowfunc.h b/sql/item_windowfunc.h
index 196e69438b5..ce9d89e62dd 100644
--- a/sql/item_windowfunc.h
+++ b/sql/item_windowfunc.h
@@ -118,28 +118,29 @@ public:
Item_sum_row_number(THD *thd)
: Item_sum_int(thd), count(0) {}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
- void clear()
+ void clear() override
{
count= 0;
}
- bool add()
+ bool add() override
{
count++;
return false;
}
- void reset_field() { DBUG_ASSERT(0); }
- void update_field() {}
+ void reset_field() override { DBUG_ASSERT(0); }
+ void update_field() override {}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return ROW_NUMBER_FUNC;
}
- longlong val_int()
+ longlong val_int() override
{
return count;
}
@@ -149,7 +150,7 @@ public:
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_row_number>(thd, this); }
};
@@ -182,26 +183,27 @@ public:
Item_sum_rank(THD *thd) : Item_sum_int(thd), peer_tracker(NULL) {}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
- void clear()
+ void clear() override
{
/* This is called on partition start */
cur_rank= 1;
row_number= 0;
}
- bool add();
+ bool add() override;
- longlong val_int()
+ longlong val_int() override
{
return cur_rank;
}
- void reset_field() { DBUG_ASSERT(0); }
- void update_field() {}
+ void reset_field() override { DBUG_ASSERT(0); }
+ void update_field() override {}
- enum Sumfunctype sum_func () const
+ enum Sumfunctype sum_func () const override
{
return RANK_FUNC;
}
@@ -212,9 +214,9 @@ public:
return name;
}
- void setup_window_func(THD *thd, Window_spec *window_spec);
+ void setup_window_func(THD *thd, Window_spec *window_spec) override;
- void cleanup()
+ void cleanup() override
{
if (peer_tracker)
{
@@ -223,7 +225,7 @@ public:
}
Item_sum_int::cleanup();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_rank>(thd, this); }
};
@@ -257,23 +259,24 @@ class Item_sum_dense_rank: public Item_sum_int
XXX(cvicentiu) This class could potentially be implemented in the rank
class, with a switch for the DENSE case.
*/
- void clear()
+ void clear() override
{
dense_rank= 0;
first_add= true;
}
- bool add();
- void reset_field() { DBUG_ASSERT(0); }
- void update_field() {}
- longlong val_int()
+ bool add() override;
+ void reset_field() override { DBUG_ASSERT(0); }
+ void update_field() override {}
+ longlong val_int() override
{
return dense_rank;
}
Item_sum_dense_rank(THD *thd)
: Item_sum_int(thd), dense_rank(0), first_add(true), peer_tracker(NULL) {}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
- enum Sumfunctype sum_func () const
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
+ enum Sumfunctype sum_func () const override
{
return DENSE_RANK_FUNC;
}
@@ -284,9 +287,9 @@ class Item_sum_dense_rank: public Item_sum_int
return name;
}
- void setup_window_func(THD *thd, Window_spec *window_spec);
+ void setup_window_func(THD *thd, Window_spec *window_spec) override;
- void cleanup()
+ void cleanup() override
{
if (peer_tracker)
{
@@ -295,7 +298,7 @@ class Item_sum_dense_rank: public Item_sum_int
}
Item_sum_int::cleanup();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_dense_rank>(thd, this); }
};
@@ -312,22 +315,22 @@ class Item_sum_hybrid_simple : public Item_sum_hybrid
value(NULL)
{ }
- bool add();
- bool fix_fields(THD *, Item **);
- bool fix_length_and_dec();
+ bool add() override;
+ bool fix_fields(THD *, Item **) override;
+ bool fix_length_and_dec() override;
void setup_hybrid(THD *thd, Item *item);
- double val_real();
- longlong val_int();
- my_decimal *val_decimal(my_decimal *);
- void reset_field();
- String *val_str(String *);
- bool val_native(THD *thd, Native *to);
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate);
- const Type_handler *type_handler() const
+ double val_real() override;
+ longlong val_int() override;
+ my_decimal *val_decimal(my_decimal *) override;
+ void reset_field() override;
+ String *val_str(String *) override;
+ bool val_native(THD *thd, Native *to) override;
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override;
+ const Type_handler *type_handler() const override
{ return Type_handler_hybrid_field_type::type_handler(); }
- void update_field();
- Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table);
- void clear()
+ void update_field() override;
+ Field *create_tmp_field(MEM_ROOT *root, bool group, TABLE *table) override;
+ void clear() override
{
value->clear();
null_value= 1;
@@ -348,7 +351,7 @@ class Item_sum_first_value : public Item_sum_hybrid_simple
Item_sum_hybrid_simple(thd, arg_expr) {}
- enum Sumfunctype sum_func () const
+ enum Sumfunctype sum_func () const override
{
return FIRST_VALUE_FUNC;
}
@@ -359,7 +362,7 @@ class Item_sum_first_value : public Item_sum_hybrid_simple
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_first_value>(thd, this); }
};
@@ -375,7 +378,7 @@ class Item_sum_last_value : public Item_sum_hybrid_simple
Item_sum_last_value(THD* thd, Item* arg_expr) :
Item_sum_hybrid_simple(thd, arg_expr) {}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return LAST_VALUE_FUNC;
}
@@ -386,7 +389,7 @@ class Item_sum_last_value : public Item_sum_hybrid_simple
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_last_value>(thd, this); }
};
@@ -397,7 +400,7 @@ class Item_sum_nth_value : public Item_sum_hybrid_simple
Item_sum_nth_value(THD *thd, Item *arg_expr, Item* offset_expr) :
Item_sum_hybrid_simple(thd, arg_expr, offset_expr) {}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return NTH_VALUE_FUNC;
}
@@ -408,7 +411,7 @@ class Item_sum_nth_value : public Item_sum_hybrid_simple
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_nth_value>(thd, this); }
};
@@ -419,7 +422,7 @@ class Item_sum_lead : public Item_sum_hybrid_simple
Item_sum_lead(THD *thd, Item *arg_expr, Item* offset_expr) :
Item_sum_hybrid_simple(thd, arg_expr, offset_expr) {}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return LEAD_FUNC;
}
@@ -430,7 +433,7 @@ class Item_sum_lead : public Item_sum_hybrid_simple
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_lead>(thd, this); }
};
@@ -441,7 +444,7 @@ class Item_sum_lag : public Item_sum_hybrid_simple
Item_sum_lag(THD *thd, Item *arg_expr, Item* offset_expr) :
Item_sum_hybrid_simple(thd, arg_expr, offset_expr) {}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return LAG_FUNC;
}
@@ -452,7 +455,7 @@ class Item_sum_lag : public Item_sum_hybrid_simple
return name;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_lag>(thd, this); }
};
@@ -506,7 +509,7 @@ class Item_sum_percent_rank: public Item_sum_double,
Item_sum_percent_rank(THD *thd)
: Item_sum_double(thd), cur_rank(1), peer_tracker(NULL) {}
- longlong val_int()
+ longlong val_int() override
{
/*
Percent rank is a real value so calling the integer value should never
@@ -516,7 +519,7 @@ class Item_sum_percent_rank: public Item_sum_double,
return 0;
}
- double val_real()
+ double val_real() override
{
/*
We can not get the real value without knowing the number of rows
@@ -529,7 +532,7 @@ class Item_sum_percent_rank: public Item_sum_double,
static_cast<double>(cur_rank - 1) / (partition_rows - 1) : 0;
}
- enum Sumfunctype sum_func () const
+ enum Sumfunctype sum_func () const override
{
return PERCENT_RANK_FUNC;
}
@@ -540,33 +543,34 @@ class Item_sum_percent_rank: public Item_sum_double,
return name;
}
- void update_field() {}
+ void update_field() override {}
- void clear()
+ void clear() override
{
cur_rank= 1;
row_number= 0;
}
- bool add();
- const Type_handler *type_handler() const { return &type_handler_double; }
+ bool add() override;
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals = 10; // TODO-cvicentiu find out how many decimals the standard
// requires.
return FALSE;
}
- void setup_window_func(THD *thd, Window_spec *window_spec);
+ void setup_window_func(THD *thd, Window_spec *window_spec) override;
- void reset_field() { DBUG_ASSERT(0); }
+ void reset_field() override { DBUG_ASSERT(0); }
- void set_partition_row_count(ulonglong count)
+ void set_partition_row_count(ulonglong count) override
{
Partition_row_count::set_partition_row_count(count);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_percent_rank>(thd, this); }
private:
@@ -575,7 +579,7 @@ class Item_sum_percent_rank: public Item_sum_double,
Group_bound_tracker *peer_tracker;
- void cleanup()
+ void cleanup() override
{
if (peer_tracker)
{
@@ -608,23 +612,23 @@ class Item_sum_cume_dist: public Item_sum_double,
Item_sum_cume_dist(THD *thd) :Item_sum_double(thd) { }
Item_sum_cume_dist(THD *thd, Item *arg) :Item_sum_double(thd, arg) { }
- double val_real()
+ double val_real() override
{
return calc_val_real(&null_value, current_row_count_);
}
- bool add()
+ bool add() override
{
current_row_count_++;
return false;
}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return CUME_DIST_FUNC;
}
- void clear()
+ void clear() override
{
current_row_count_= 0;
partition_row_count_= 0;
@@ -636,24 +640,25 @@ class Item_sum_cume_dist: public Item_sum_double,
return name;
}
- void update_field() {}
- const Type_handler *type_handler() const { return &type_handler_double; }
+ void update_field() override {}
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals = 10; // TODO-cvicentiu find out how many decimals the standard
// requires.
return FALSE;
}
- void reset_field() { DBUG_ASSERT(0); }
+ void reset_field() override { DBUG_ASSERT(0); }
- void set_partition_row_count(ulonglong count)
+ void set_partition_row_count(ulonglong count) override
{
Partition_row_count::set_partition_row_count(count);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_cume_dist>(thd, this); }
};
@@ -667,7 +672,7 @@ class Item_sum_ntile : public Item_sum_int,
Item_sum_int(thd, num_quantiles_expr), n_old_val_(0)
{ }
- longlong val_int()
+ longlong val_int() override
{
if (get_row_count() == 0)
{
@@ -694,18 +699,18 @@ class Item_sum_ntile : public Item_sum_int,
return (current_row_count_ - 1 - extra_rows) / quantile_size + 1;
}
- bool add()
+ bool add() override
{
current_row_count_++;
return false;
}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return NTILE_FUNC;
}
- void clear()
+ void clear() override
{
current_row_count_= 0;
partition_row_count_= 0;
@@ -718,18 +723,19 @@ class Item_sum_ntile : public Item_sum_int,
return name;
}
- void update_field() {}
+ void update_field() override {}
- const Type_handler *type_handler() const { return &type_handler_slonglong; }
+ const Type_handler *type_handler() const override
+ { return &type_handler_slonglong; }
- void reset_field() { DBUG_ASSERT(0); }
+ void reset_field() override { DBUG_ASSERT(0); }
- void set_partition_row_count(ulonglong count)
+ void set_partition_row_count(ulonglong count) override
{
Partition_row_count::set_partition_row_count(count);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_ntile>(thd, this); }
private:
@@ -748,7 +754,7 @@ public:
value(NULL), val_calculated(FALSE), first_call(TRUE),
prev_value(0), order_item(NULL){}
- double val_real()
+ double val_real() override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -759,7 +765,7 @@ public:
return value->val_real();
}
- longlong val_int()
+ longlong val_int() override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -770,7 +776,7 @@ public:
return value->val_int();
}
- my_decimal* val_decimal(my_decimal* dec)
+ my_decimal* val_decimal(my_decimal* dec) override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -781,7 +787,7 @@ public:
return value->val_decimal(dec);
}
- String* val_str(String *str)
+ String* val_str(String *str) override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -792,7 +798,7 @@ public:
return value->val_str(str);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -803,7 +809,7 @@ public:
return value->get_date(thd, ltime, fuzzydate);
}
- bool val_native(THD *thd, Native *to)
+ bool val_native(THD *thd, Native *to) override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -814,7 +820,7 @@ public:
return value->val_native(thd, to);
}
- bool add()
+ bool add() override
{
Item *arg= get_arg(0);
if (arg->is_null())
@@ -855,12 +861,12 @@ public:
return false;
}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return PERCENTILE_DISC_FUNC;
}
- void clear()
+ void clear() override
{
val_calculated= false;
first_call= true;
@@ -875,29 +881,29 @@ public:
return name;
}
- void update_field() {}
- const Type_handler *type_handler() const
+ void update_field() override {}
+ const Type_handler *type_handler() const override
{return Type_handler_hybrid_field_type::type_handler();}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals = 10; // TODO-cvicentiu find out how many decimals the standard
// requires.
return FALSE;
}
- void reset_field() { DBUG_ASSERT(0); }
+ void reset_field() override { DBUG_ASSERT(0); }
- void set_partition_row_count(ulonglong count)
+ void set_partition_row_count(ulonglong count) override
{
Partition_row_count::set_partition_row_count(count);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_percentile_disc>(thd, this); }
- void setup_window_func(THD *thd, Window_spec *window_spec);
+ void setup_window_func(THD *thd, Window_spec *window_spec) override;
void setup_hybrid(THD *thd, Item *item);
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_fields(THD *thd, Item **ref) override;
private:
Item_cache *value;
@@ -916,7 +922,7 @@ public:
floor_value(NULL), ceil_value(NULL), first_call(TRUE),prev_value(0),
ceil_val_calculated(FALSE), floor_val_calculated(FALSE), order_item(NULL){}
- double val_real()
+ double val_real() override
{
if (get_row_count() == 0 || get_arg(0)->is_null())
{
@@ -943,7 +949,7 @@ public:
return ret_val;
}
- bool add()
+ bool add() override
{
Item *arg= get_arg(0);
if (arg->is_null())
@@ -993,12 +999,12 @@ public:
return false;
}
- enum Sumfunctype sum_func() const
+ enum Sumfunctype sum_func() const override
{
return PERCENTILE_CONT_FUNC;
}
- void clear()
+ void clear() override
{
first_call= true;
floor_value->clear();
@@ -1014,27 +1020,27 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("percentile_cont") };
return name;
}
- void update_field() {}
+ void update_field() override {}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
decimals = 10; // TODO-cvicentiu find out how many decimals the standard
// requires.
return FALSE;
}
- void reset_field() { DBUG_ASSERT(0); }
+ void reset_field() override { DBUG_ASSERT(0); }
- void set_partition_row_count(ulonglong count)
+ void set_partition_row_count(ulonglong count) override
{
Partition_row_count::set_partition_row_count(count);
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_sum_percentile_cont>(thd, this); }
- void setup_window_func(THD *thd, Window_spec *window_spec);
+ void setup_window_func(THD *thd, Window_spec *window_spec) override;
void setup_hybrid(THD *thd, Item *item);
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_fields(THD *thd, Item **ref) override;
private:
Item_cache *floor_value;
@@ -1072,7 +1078,7 @@ public:
Item_sum *window_func() const { return (Item_sum *) args[0]; }
- void update_used_tables();
+ void update_used_tables() override;
/*
This is used by filesort to mark the columns it needs to read (because they
@@ -1083,7 +1089,7 @@ public:
have been computed. In that case, window function will need to read its
temp.table field. In order to allow that, mark that field in the read_set.
*/
- bool register_field_in_read_map(void *arg)
+ bool register_field_in_read_map(void *arg) override
{
TABLE *table= (TABLE*) arg;
if (result_field && (result_field->table == table || !table))
@@ -1186,11 +1192,11 @@ public:
*/
void setup_partition_border_check(THD *thd);
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return ((Item_sum *) args[0])->type_handler();
}
- enum Item::Type type() const { return Item::WINDOW_FUNC_ITEM; }
+ enum Item::Type type() const override { return Item::WINDOW_FUNC_ITEM; }
private:
/*
@@ -1233,7 +1239,7 @@ public:
read_value_from_result_field= true;
}
- bool is_null()
+ bool is_null() override
{
if (force_return_blank)
return true;
@@ -1244,7 +1250,7 @@ public:
return window_func()->is_null();
}
- double val_real()
+ double val_real() override
{
double res;
if (force_return_blank)
@@ -1265,7 +1271,7 @@ public:
return res;
}
- longlong val_int()
+ longlong val_int() override
{
longlong res;
if (force_return_blank)
@@ -1286,7 +1292,7 @@ public:
return res;
}
- String* val_str(String* str)
+ String* val_str(String* str) override
{
String *res;
if (force_return_blank)
@@ -1309,7 +1315,7 @@ public:
return res;
}
- bool val_native(THD *thd, Native *to)
+ bool val_native(THD *thd, Native *to) override
{
if (force_return_blank)
return null_value= true;
@@ -1318,7 +1324,7 @@ public:
return val_native_from_item(thd, window_func(), to);
}
- my_decimal* val_decimal(my_decimal* dec)
+ my_decimal* val_decimal(my_decimal* dec) override
{
my_decimal *res;
if (force_return_blank)
@@ -1341,7 +1347,7 @@ public:
return res;
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
bool res;
if (force_return_blank)
@@ -1365,9 +1371,9 @@ public:
}
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
- List<Item> &fields, uint flags);
+ List<Item> &fields, uint flags) override;
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
Type_std_attributes::set(window_func());
return FALSE;
@@ -1379,13 +1385,13 @@ public:
return name;
}
- bool fix_fields(THD *thd, Item **ref);
+ bool fix_fields(THD *thd, Item **ref) override;
bool resolve_window_name(THD *thd);
- void print(String *str, enum_query_type query_type);
+ void print(String *str, enum_query_type query_type) override;
- Item *get_copy(THD *thd) { return 0; }
+ Item *get_copy(THD *thd) override { return 0; }
};
diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc
index b926564bdf9..0f5cc1c1250 100644
--- a/sql/item_xmlfunc.cc
+++ b/sql/item_xmlfunc.cc
@@ -1,5 +1,5 @@
/* Copyright (c) 2005, 2019, Oracle and/or its affiliates.
- Copyright (c) 2009, 2020, MariaDB
+ Copyright (c) 2009, 2021, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -141,21 +141,21 @@ public:
fltend= (MY_XPATH_FLT*) tmp_native_value.end();
nodeset->length(0);
}
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
return &type_handler_xpath_nodeset;
}
- const Type_handler *fixed_type_handler() const
+ const Type_handler *fixed_type_handler() const override
{
return &type_handler_xpath_nodeset;
}
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
DBUG_ASSERT(0);
return NULL;
}
- String *val_str(String *str)
+ String *val_str(String *str) override
{
prepare_nodes();
val_native(current_thd, &tmp2_native_value);
@@ -189,7 +189,7 @@ public:
}
return str;
}
- bool fix_length_and_dec()
+ bool fix_length_and_dec() override
{
max_length= MAX_BLOB_WIDTH;
collation.collation= pxml->charset();
@@ -202,7 +202,7 @@ public:
{
return { STRING_WITH_LEN("nodeset") };
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE);
}
@@ -220,8 +220,8 @@ public:
{
return { STRING_WITH_LEN("xpath_rootelement") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_rootelement>(thd, this); }
};
@@ -236,8 +236,8 @@ public:
{
return { STRING_WITH_LEN("xpath_union") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_union>(thd, this); }
};
@@ -276,8 +276,8 @@ public:
{
return { STRING_WITH_LEN("xpath_selfbyname") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_selfbyname>(thd, this); }
};
@@ -293,8 +293,8 @@ public:
{
return { STRING_WITH_LEN("xpath_childbyname") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_childbyname>(thd, this); }
};
@@ -312,8 +312,8 @@ public:
{
return { STRING_WITH_LEN("xpath_descendantbyname") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_descendantbyname>(thd, this); }
};
@@ -331,8 +331,8 @@ public:
{
return { STRING_WITH_LEN("xpath_ancestorbyname") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_ancestorbyname>(thd, this); }
};
@@ -349,8 +349,8 @@ public:
{
return { STRING_WITH_LEN("xpath_parentbyname") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_parentbyname>(thd, this); }
};
@@ -366,8 +366,8 @@ public:
{
return { STRING_WITH_LEN("xpath_attributebyname") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_attributebyname>(thd, this); }
};
@@ -386,8 +386,8 @@ public:
{
return { STRING_WITH_LEN("xpath_predicate") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_predicate>(thd, this); }
};
@@ -402,8 +402,8 @@ public:
{
return { STRING_WITH_LEN("xpath_elementbyindex") };
}
- bool val_native(THD *thd, Native *nodeset);
- Item *get_copy(THD *thd)
+ bool val_native(THD *thd, Native *nodeset) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_elementbyindex>(thd, this); }
};
@@ -425,7 +425,7 @@ public:
{
return { STRING_WITH_LEN("xpath_cast_bool") };
}
- longlong val_int()
+ longlong val_int() override
{
if (args[0]->fixed_type_handler() == &type_handler_xpath_nodeset)
{
@@ -434,7 +434,7 @@ public:
}
return args[0]->val_real() ? 1 : 0;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_xpath_cast_bool>(thd, this); }
};
@@ -450,8 +450,8 @@ public:
{
return { STRING_WITH_LEN("xpath_cast_number") };
}
- virtual double val_real() { return args[0]->val_real(); }
- Item *get_copy(THD *thd)
+ double val_real() override { return args[0]->val_real(); }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_xpath_cast_number>(thd, this); }
};
@@ -465,12 +465,13 @@ public:
Native *native_cache;
Item_nodeset_context_cache(THD *thd, Native *native_arg, String *pxml):
Item_nodeset_func(thd, pxml), native_cache(native_arg) { }
- bool val_native(THD *thd, Native *nodeset)
+ bool val_native(THD *, Native *nodeset) override
{
return nodeset->copy(*native_cache);
}
- bool fix_length_and_dec() { max_length= MAX_BLOB_WIDTH;; return FALSE; }
- Item *get_copy(THD *thd)
+ bool fix_length_and_dec() override
+ { max_length= MAX_BLOB_WIDTH; return FALSE; }
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_context_cache>(thd, this); }
};
@@ -486,15 +487,15 @@ public:
{
return { STRING_WITH_LEN("xpath_position") };
}
- bool fix_length_and_dec() { max_length=10; return FALSE; }
- longlong val_int()
+ bool fix_length_and_dec() override { max_length=10; return FALSE; }
+ longlong val_int() override
{
args[0]->val_native(current_thd, &tmp_native_value);
if (tmp_native_value.elements() == 1)
return tmp_native_value.element(0).pos + 1;
return 0;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xpath_position>(thd, this); }
};
@@ -510,8 +511,8 @@ public:
{
return { STRING_WITH_LEN("xpath_count") };
}
- bool fix_length_and_dec() { max_length=10; return FALSE; }
- longlong val_int()
+ bool fix_length_and_dec() override { max_length=10; return FALSE; }
+ longlong val_int() override
{
uint predicate_supplied_context_size;
args[0]->val_native(current_thd, &tmp_native_value);
@@ -520,7 +521,7 @@ public:
return predicate_supplied_context_size;
return tmp_native_value.elements();
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xpath_count>(thd, this); }
};
@@ -537,7 +538,7 @@ public:
{
return { STRING_WITH_LEN("xpath_sum") };
}
- double val_real()
+ double val_real() override
{
double sum= 0;
args[0]->val_native(current_thd, &tmp_native_value);
@@ -568,7 +569,7 @@ public:
}
return sum;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xpath_sum>(thd, this); }
};
@@ -612,17 +613,17 @@ public:
{
return { STRING_WITH_LEN("xpath_nodeset_to_const_comparator") };
}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE);
}
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
DBUG_ASSERT(0);
return NULL;
}
- longlong val_int()
+ longlong val_int() override
{
Item_func *comp= (Item_func*)args[1];
Item_string_xml_non_const *fake=
@@ -653,7 +654,7 @@ public:
}
return 0;
}
- Item *get_copy(THD *thd)
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_to_const_comparator>(thd, this); }
};
diff --git a/sql/item_xmlfunc.h b/sql/item_xmlfunc.h
index 366958710a4..e2ffe2fa630 100644
--- a/sql/item_xmlfunc.h
+++ b/sql/item_xmlfunc.h
@@ -117,9 +117,9 @@ public:
{
set_maybe_null();
}
- bool fix_fields(THD *thd, Item **ref);
- bool fix_length_and_dec();
- bool const_item() const
+ bool fix_fields(THD *thd, Item **ref) override;
+ bool fix_length_and_dec() override;
+ bool const_item() const override
{
return const_item_cache && (!nodeset_func || nodeset_func->const_item());
}
@@ -136,8 +136,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("extractvalue") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xml_extractvalue>(thd, this); }
};
@@ -157,8 +157,8 @@ public:
static LEX_CSTRING name= {STRING_WITH_LEN("updatexml") };
return name;
}
- String *val_str(String *);
- Item *get_copy(THD *thd)
+ String *val_str(String *) override;
+ Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xml_update>(thd, this); }
};
diff --git a/sql/procedure.h b/sql/procedure.h
index 769eac5f217..c83a52ff19c 100644
--- a/sql/procedure.h
+++ b/sql/procedure.h
@@ -44,9 +44,9 @@ public:
this->name.str= name_par;
this->name.length= strlen(name_par);
}
- enum Type type() const { return Item::PROC_ITEM; }
+ enum Type type() const override { return Item::PROC_ITEM; }
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src,
- const Tmp_field_param *param)
+ const Tmp_field_param *param) override
{
/*
We can get to here when using a CURSOR for a query with PROCEDURE:
@@ -58,19 +58,19 @@ public:
virtual void set(double nr)=0;
virtual void set(const char *str,uint length,CHARSET_INFO *cs)=0;
virtual void set(longlong nr)=0;
- const Type_handler *type_handler() const=0;
+ const Type_handler *type_handler() const override=0;
void set(const char *str) { set(str,(uint) strlen(str), default_charset()); }
unsigned int size_of() { return sizeof(*this);}
- bool check_vcol_func_processor(void *arg)
+ bool check_vcol_func_processor(void *arg) override
{
DBUG_ASSERT(0); // impossible
return mark_unsupported_function("proc", arg, VCOL_IMPOSSIBLE);
}
- bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate)
+ bool get_date(THD *thd, MYSQL_TIME *ltime, date_mode_t fuzzydate) override
{
return type_handler()->Item_get_date_with_warn(thd, this, ltime, fuzzydate);
}
- Item* get_copy(THD *thd) { return 0; }
+ Item* get_copy(THD *thd) override { return 0; }
};
class Item_proc_real :public Item_proc
@@ -82,23 +82,24 @@ public:
{
decimals=dec; max_length=float_length(dec);
}
- const Type_handler *type_handler() const { return &type_handler_double; }
- void set(double nr) { value=nr; }
- void set(longlong nr) { value=(double) nr; }
- void set(const char *str,uint length,CHARSET_INFO *cs)
+ const Type_handler *type_handler() const override
+ { return &type_handler_double; }
+ void set(double nr) override { value=nr; }
+ void set(longlong nr) override { value=(double) nr; }
+ void set(const char *str,uint length,CHARSET_INFO *cs) override
{
int err_not_used;
char *end_not_used;
value= cs->strntod((char*) str,length, &end_not_used, &err_not_used);
}
- double val_real() { return value; }
- longlong val_int() { return (longlong) value; }
- String *val_str(String *s)
+ double val_real() override { return value; }
+ longlong val_int() override { return (longlong) value; }
+ String *val_str(String *s) override
{
s->set_real(value,decimals,default_charset());
return s;
}
- my_decimal *val_decimal(my_decimal *);
+ my_decimal *val_decimal(my_decimal *) override;
unsigned int size_of() { return sizeof(*this);}
};
@@ -108,20 +109,21 @@ class Item_proc_int :public Item_proc
public:
Item_proc_int(THD *thd, const char *name_par): Item_proc(thd, name_par)
{ max_length=11; }
- const Type_handler *type_handler() const
+ const Type_handler *type_handler() const override
{
if (unsigned_flag)
return &type_handler_ulonglong;
return &type_handler_slonglong;
}
- void set(double nr) { value=(longlong) nr; }
- void set(longlong nr) { value=nr; }
- void set(const char *str,uint length, CHARSET_INFO *cs)
+ void set(double nr) override { value=(longlong) nr; }
+ void set(longlong nr) override { value=nr; }
+ void set(const char *str,uint length, CHARSET_INFO *cs) override
{ int err; value= cs->strntoll(str,length,10,NULL,&err); }
- double val_real() { return (double) value; }
- longlong val_int() { return value; }
- String *val_str(String *s) { s->set(value, default_charset()); return s; }
- my_decimal *val_decimal(my_decimal *);
+ double val_real() override { return (double) value; }
+ longlong val_int() override { return value; }
+ String *val_str(String *s) override
+ { s->set(value, default_charset()); return s; }
+ my_decimal *val_decimal(my_decimal *) override;
unsigned int size_of() { return sizeof(*this);}
};
@@ -131,12 +133,13 @@ class Item_proc_string :public Item_proc
public:
Item_proc_string(THD *thd, const char *name_par, uint length):
Item_proc(thd, name_par) { this->max_length=length; }
- const Type_handler *type_handler() const { return &type_handler_varchar; }
- void set(double nr) { str_value.set_real(nr, 2, default_charset()); }
- void set(longlong nr) { str_value.set(nr, default_charset()); }
- void set(const char *str, uint length, CHARSET_INFO *cs)
+ const Type_handler *type_handler() const override
+ { return &type_handler_varchar; }
+ void set(double nr) override { str_value.set_real(nr, 2, default_charset()); }
+ void set(longlong nr) override { str_value.set(nr, default_charset()); }
+ void set(const char *str, uint length, CHARSET_INFO *cs) override
{ str_value.copy(str,length,cs); }
- double val_real()
+ double val_real() override
{
int err_not_used;
char *end_not_used;
@@ -144,17 +147,17 @@ public:
return cs->strntod((char*) str_value.ptr(), str_value.length(),
&end_not_used, &err_not_used);
}
- longlong val_int()
+ longlong val_int() override
{
int err;
CHARSET_INFO *cs=str_value.charset();
return cs->strntoll(str_value.ptr(),str_value.length(),10,NULL,&err);
}
- String *val_str(String*)
+ String *val_str(String*) override
{
return null_value ? (String*) 0 : (String*) &str_value;
}
- my_decimal *val_decimal(my_decimal *);
+ my_decimal *val_decimal(my_decimal *) override;
unsigned int size_of() { return sizeof(*this);}
};
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index ffc9c0e19af..a2b26ac01e1 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -60,7 +60,8 @@ public:
Spvar_definition field_def;
/// Field-type of the SP-variable.
- const Type_handler *type_handler() const { return field_def.type_handler(); }
+ const Type_handler *type_handler() const
+ { return field_def.type_handler(); }
public:
sp_variable(const LEX_CSTRING *name_arg, uint offset_arg)
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 98ded8f142e..8e4aefbbe5b 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -6985,7 +6985,8 @@ public:
~my_var_sp() { }
bool set(THD *thd, Item *val);
my_var_sp *get_my_var_sp() { return this; }
- const Type_handler *type_handler() const { return m_type_handler; }
+ const Type_handler *type_handler() const
+ { return m_type_handler; }
sp_rcontext *get_rcontext(sp_rcontext *local_ctx) const;
};
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 95d896c8cd4..45291541c8d 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -1960,8 +1960,8 @@ class store_key_field: public store_key
}
}
- enum Type type() const { return FIELD_STORE_KEY; }
- const char *name() const { return field_name; }
+ enum Type type() const override { return FIELD_STORE_KEY; }
+ const char *name() const override { return field_name; }
void change_source_field(Item_field *fld_item)
{
@@ -1970,7 +1970,7 @@ class store_key_field: public store_key
}
protected:
- enum store_key_result copy_inner()
+ enum store_key_result copy_inner() override
{
TABLE *table= copy_field.to_field->table;
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
@@ -2013,11 +2013,11 @@ public:
{}
- enum Type type() const { return ITEM_STORE_KEY; }
- const char *name() const { return "func"; }
+ enum Type type() const override { return ITEM_STORE_KEY; }
+ const char *name() const override { return "func"; }
protected:
- enum store_key_result copy_inner()
+ enum store_key_result copy_inner() override
{
TABLE *table= to_field->table;
MY_BITMAP *old_map= dbug_tmp_use_all_columns(table,
@@ -2066,12 +2066,12 @@ public:
:store_key_item(arg, new_item, FALSE), inited(0)
{}
- enum Type type() const { return CONST_ITEM_STORE_KEY; }
- const char *name() const { return "const"; }
- bool store_key_is_const() { return true; }
+ enum Type type() const override { return CONST_ITEM_STORE_KEY; }
+ const char *name() const override { return "const"; }
+ bool store_key_is_const() override { return true; }
protected:
- enum store_key_result copy_inner()
+ enum store_key_result copy_inner() override
{
int res;
if (!inited)
diff --git a/storage/maria/ha_s3.h b/storage/maria/ha_s3.h
index e16353b2a32..e8c7f586a1b 100644
--- a/storage/maria/ha_s3.h
+++ b/storage/maria/ha_s3.h
@@ -54,12 +54,12 @@ public:
DBUG_ENTER("analyze");
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
- int repair(THD *, HA_CHECK_OPT *) override
+ int repair(THD * thd, HA_CHECK_OPT * check_opt) override
{
DBUG_ENTER("repair");
DBUG_RETURN(HA_ERR_TABLE_READONLY);
}
- int preload_keys(THD *, HA_CHECK_OPT *) override
+ int preload_keys(THD * thd, HA_CHECK_OPT * check_opt) override
{
DBUG_ENTER("preload_keys");
DBUG_RETURN(HA_ERR_TABLE_READONLY);