Commit 30f0a246 authored by Monty's avatar Monty Committed by Sergei Golubchik

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
parent 53b43f30
......@@ -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 @@ class Item_func_sysconst_test :public Item_func_sysconst
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); }
};
......
......@@ -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 @@ class Item_func_inet_aton : public Item_longlong_func
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 @@ class Item_func_inet6_aton : public Item_str_func
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 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
return name;
}
virtual bool fix_length_and_dec()
bool fix_length_and_dec() override
{
decimals= 0;
......@@ -155,8 +155,8 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
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 @@ class Item_func_is_ipv4 : public Item_func_inet_bool_base
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 @@ class Item_func_is_ipv6 : public Item_func_inet_bool_base
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 @@ class Item_func_is_ipv4_compat : public Item_func_inet_bool_base
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 @@ class Item_func_is_ipv4_mapped : public Item_func_inet_bool_base
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
......@@ -1198,7 +1198,7 @@ class Field: public Value_source
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 @@ class Field_varstring :public Field_longstr {
{
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 @@ class Field_blob :public Field_longstr {
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);
}
......
......@@ -467,7 +467,7 @@ class ha_partition :public handler
}
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();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -54,101 +54,103 @@ class Item_row: public Item_fixed_hybrid,
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 */
This diff is collapsed.
......@@ -304,29 +304,30 @@ class Item_singlerow_subselect :public Item_subselect
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 @@ class Item_singlerow_subselect :public Item_subselect
*/
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 @@ class Item_maxmin_subselect :public Item_singlerow_subselect
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 */
......
This diff is collapsed.
This diff is collapsed.
......@@ -33,12 +33,9 @@ class Item_func_history: public Item_bool_func
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 @@ class Item_func_history: public Item_bool_func
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 @@ class Item_func_trt_ts: public Item_datetimefunc
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 @@ class Item_func_trt_id : public Item_longlong_func
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 @@ class Item_func_trt_trx_sees : public Item_bool_func
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); }
};
......
This diff is collapsed.
/* 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 @@ class Item_nodeset_func :public Item_str_func
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 @@ class Item_nodeset_func :public Item_str_func
}
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 @@ class Item_nodeset_func :public Item_str_func
{
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 @@ class Item_nodeset_func_rootelement :public Item_nodeset_func
{
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 @@ class Item_nodeset_func_union :public Item_nodeset_func
{
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 @@ class Item_nodeset_func_selfbyname: public Item_nodeset_func_axisbyname
{
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 @@ class Item_nodeset_func_childbyname: public Item_nodeset_func_axisbyname
{
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 @@ class Item_nodeset_func_descendantbyname: public Item_nodeset_func_axisbyname
{
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 @@ class Item_nodeset_func_ancestorbyname: public Item_nodeset_func_axisbyname
{
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 @@ class Item_nodeset_func_parentbyname: public Item_nodeset_func_axisbyname
{
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 @@ class Item_nodeset_func_attributebyname: public Item_nodeset_func_axisbyname
{
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 @@ class Item_nodeset_func_predicate :public Item_nodeset_func
{
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 @@ class Item_nodeset_func_elementbyindex :public Item_nodeset_func
{
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 @@ class Item_xpath_cast_bool :public Item_bool_func
{
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 @@ class Item_xpath_cast_bool :public Item_bool_func
}
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 @@ class Item_xpath_cast_number :public Item_real_func
{
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 @@ class Item_nodeset_context_cache :public Item_nodeset_func
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 @@ class Item_func_xpath_position :public Item_long_func
{
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 @@ class Item_func_xpath_count :public Item_long_func
{
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 @@ class Item_func_xpath_count :public Item_long_func
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 @@ class Item_func_xpath_sum :public Item_real_func
{
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 @@ class Item_func_xpath_sum :public Item_real_func
}
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 @@ class Item_nodeset_to_const_comparator :public Item_bool_func
{
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 @@ class Item_nodeset_to_const_comparator :public Item_bool_func
}
return 0;
}
Item *get_copy(THD *thd)
Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_to_const_comparator>(thd, this); }
};
......
This diff is collapsed.
This diff is collapsed.
......@@ -60,7 +60,8 @@ class sp_variable : public Sql_alloc
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)
......
......@@ -6985,7 +6985,8 @@ class my_var_sp: public my_var {
~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;
};
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment