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 ...@@ -24,12 +24,12 @@ class Item_func_sysconst_test :public Item_func_sysconst
{ {
public: public:
Item_func_sysconst_test(THD *thd): Item_func_sysconst(thd) {} 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); null_value= str->copy(STRING_WITH_LEN("sysconst_test"), system_charset_info);
return null_value ? NULL : str; 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; max_length= MAX_FIELD_NAME * system_charset_info->mbmaxlen;
set_maybe_null(); set_maybe_null();
...@@ -40,8 +40,9 @@ class Item_func_sysconst_test :public Item_func_sysconst ...@@ -40,8 +40,9 @@ class Item_func_sysconst_test :public Item_func_sysconst
static LEX_CSTRING name= {STRING_WITH_LEN("sysconst_test") }; static LEX_CSTRING name= {STRING_WITH_LEN("sysconst_test") };
return name; return name;
} }
const char *fully_qualified_func_name() const { return "sysconst_test()"; } const char *fully_qualified_func_name() const override
Item *get_copy(THD *thd) { return "sysconst_test()"; }
Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_sysconst_test>(thd, this); } { return get_item_copy<Item_func_sysconst_test>(thd, this); }
}; };
......
...@@ -27,17 +27,17 @@ ...@@ -27,17 +27,17 @@
class Item_func_inet_aton : public Item_longlong_func 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); } { return check_argument_types_can_return_text(0, arg_count); }
public: public:
Item_func_inet_aton(THD *thd, Item *a): Item_longlong_func(thd, a) {} 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 LEX_CSTRING func_name_cstring() const override
{ {
static LEX_CSTRING name= {STRING_WITH_LEN("inet_aton") }; static LEX_CSTRING name= {STRING_WITH_LEN("inet_aton") };
return name; return name;
} }
bool fix_length_and_dec() bool fix_length_and_dec() override
{ {
decimals= 0; decimals= 0;
max_length= 21; max_length= 21;
...@@ -45,7 +45,7 @@ class Item_func_inet_aton : public Item_longlong_func ...@@ -45,7 +45,7 @@ class Item_func_inet_aton : public Item_longlong_func
unsigned_flag= 1; unsigned_flag= 1;
return FALSE; return FALSE;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_inet_aton>(thd, this); } { return get_item_copy<Item_func_inet_aton>(thd, this); }
}; };
...@@ -59,20 +59,20 @@ class Item_func_inet_ntoa : public Item_str_func ...@@ -59,20 +59,20 @@ class Item_func_inet_ntoa : public Item_str_func
public: public:
Item_func_inet_ntoa(THD *thd, Item *a): Item_str_func(thd, a) 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 LEX_CSTRING func_name_cstring() const override
{ {
static LEX_CSTRING name= {STRING_WITH_LEN("inet_ntoa") }; static LEX_CSTRING name= {STRING_WITH_LEN("inet_ntoa") };
return name; return name;
} }
bool fix_length_and_dec() bool fix_length_and_dec() override
{ {
decimals= 0; decimals= 0;
fix_length_and_charset(3 * 8 + 7, default_charset()); fix_length_and_charset(3 * 8 + 7, default_charset());
set_maybe_null(); set_maybe_null();
return FALSE; return FALSE;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_inet_ntoa>(thd, this); } { return get_item_copy<Item_func_inet_ntoa>(thd, this); }
}; };
...@@ -111,17 +111,17 @@ class Item_func_inet6_aton : public Item_str_func ...@@ -111,17 +111,17 @@ class Item_func_inet6_aton : public Item_str_func
static LEX_CSTRING name= {STRING_WITH_LEN("inet6_aton") }; static LEX_CSTRING name= {STRING_WITH_LEN("inet6_aton") };
return name; return name;
} }
virtual bool fix_length_and_dec() bool fix_length_and_dec() override
{ {
decimals= 0; decimals= 0;
fix_length_and_charset(16, &my_charset_bin); fix_length_and_charset(16, &my_charset_bin);
set_maybe_null(); set_maybe_null();
return FALSE; return FALSE;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_inet6_aton>(thd, this); } { 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 ...@@ -143,7 +143,7 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
return name; return name;
} }
virtual bool fix_length_and_dec() bool fix_length_and_dec() override
{ {
decimals= 0; decimals= 0;
...@@ -155,8 +155,8 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func ...@@ -155,8 +155,8 @@ class Item_func_inet6_ntoa : public Item_str_ascii_func
set_maybe_null();; set_maybe_null();;
return FALSE; return FALSE;
} }
String *val_str_ascii(String *to); String *val_str_ascii(String *to) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_inet6_ntoa>(thd, this); } { 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 ...@@ -178,10 +178,10 @@ class Item_func_is_ipv4 : public Item_func_inet_bool_base
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4") }; static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4") };
return name; return name;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_is_ipv4>(thd, this); } { 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 ...@@ -201,10 +201,10 @@ class Item_func_is_ipv6 : public Item_func_inet_bool_base
static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv6") }; static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv6") };
return name; return name;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_is_ipv6>(thd, this); } { 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 ...@@ -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") }; static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_compat") };
return name; return name;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_is_ipv4_compat>(thd, this); } { 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 ...@@ -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") }; static LEX_CSTRING name= {STRING_WITH_LEN("is_ipv4_mapped") };
return name; return name;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_is_ipv4_mapped>(thd, this); } { return get_item_copy<Item_func_is_ipv4_mapped>(thd, this); }
longlong val_int(); longlong val_int() override;
}; };
#endif // ITEM_INETFUNC_INCLUDED #endif // ITEM_INETFUNC_INCLUDED
...@@ -1198,7 +1198,7 @@ class Field: public Value_source ...@@ -1198,7 +1198,7 @@ class Field: public Value_source
virtual uint16 key_part_flag() const { return 0; } virtual uint16 key_part_flag() const { return 0; }
virtual uint16 key_part_length_bytes() const { return 0; } virtual uint16 key_part_length_bytes() const { return 0; }
virtual uint32 key_length() const { return pack_length(); } 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 virtual enum_field_types type() const
{ {
return type_handler()->field_type(); return type_handler()->field_type();
...@@ -4155,7 +4155,7 @@ class Field_varstring :public Field_longstr { ...@@ -4155,7 +4155,7 @@ class Field_varstring :public Field_longstr {
{ {
return (uint32) field_length + sort_suffix_length(); 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); return (field_charset() == &my_charset_bin ? length_bytes : 0);
} }
...@@ -4505,7 +4505,7 @@ class Field_blob :public Field_longstr { ...@@ -4505,7 +4505,7 @@ class Field_blob :public Field_longstr {
uint32 sort_length() const override; uint32 sort_length() const override;
uint32 sort_suffix_length() const override; uint32 sort_suffix_length() const override;
uint32 value_length() override { return get_length(); } 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); return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
} }
......
...@@ -467,7 +467,7 @@ class ha_partition :public handler ...@@ -467,7 +467,7 @@ class ha_partition :public handler
} }
Partition_share *get_part_share() { return part_share; } Partition_share *get_part_share() { return part_share; }
handler *clone(const char *name, MEM_ROOT *mem_root) override; 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_part_info= part_info;
m_is_sub_partitioned= part_info->is_sub_partitioned(); 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, ...@@ -54,101 +54,103 @@ class Item_row: public Item_fixed_hybrid,
not_null_tables_cache(0), with_null(0) not_null_tables_cache(0), with_null(0)
{ } { }
enum Type type() const { return ROW_ITEM; }; enum Type type() const override { return ROW_ITEM; };
const Type_handler *type_handler() const { return &type_handler_row; } 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, 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 return NULL; // Check with Vicentiu why it's called for Item_row
} }
void illegal_method_call(const char *); void illegal_method_call(const char *);
bool is_null() { return null_value; } bool is_null() override { return null_value; }
void make_send_field(THD *thd, Send_field *) void make_send_field(THD *thd, Send_field *) override
{ {
illegal_method_call((const char*)"make_send_field"); illegal_method_call((const char*)"make_send_field");
}; };
double val_real() double val_real() override
{ {
illegal_method_call((const char*)"val"); illegal_method_call((const char*)"val");
return 0; return 0;
}; };
longlong val_int() longlong val_int() override
{ {
illegal_method_call((const char*)"val_int"); illegal_method_call((const char*)"val_int");
return 0; return 0;
}; };
String *val_str(String *) String *val_str(String *) override
{ {
illegal_method_call((const char*)"val_str"); illegal_method_call((const char*)"val_str");
return 0; return 0;
}; };
my_decimal *val_decimal(my_decimal *) my_decimal *val_decimal(my_decimal *) override
{ {
illegal_method_call((const char*)"val_decimal"); illegal_method_call((const char*)"val_decimal");
return 0; 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"); illegal_method_call((const char*)"get_date");
return true; return true;
} }
bool fix_fields(THD *thd, Item **ref); bool fix_fields(THD *thd, Item **ref) override;
void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge); void fix_after_pullout(st_select_lex *new_parent, Item **ref, bool merge)
void cleanup(); override;
void cleanup() override;
void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array, void split_sum_func(THD *thd, Ref_ptr_array ref_pointer_array,
List<Item> &fields, uint flags); List<Item> &fields, uint flags) override;
table_map used_tables() const { return used_tables_cache; }; table_map used_tables() const override { return used_tables_cache; };
bool const_item() const { return const_item_cache; }; bool const_item() const override { return const_item_cache; };
void update_used_tables() void update_used_tables() override
{ {
used_tables_and_const_cache_init(); used_tables_and_const_cache_init();
used_tables_and_const_cache_update_and_join(arg_count, args); used_tables_and_const_cache_update_and_join(arg_count, args);
} }
table_map not_null_tables() const { return not_null_tables_cache; } table_map not_null_tables() const override { return not_null_tables_cache; }
virtual void print(String *str, enum_query_type query_type); 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)) if (walk_args(processor, walk_subquery, arg))
return true; return true;
return (this->*processor)(arg); return (this->*processor)(arg);
} }
Item *transform(THD *thd, Item_transformer transformer, uchar *arg); Item *transform(THD *thd, Item_transformer transformer, uchar *arg) override;
bool eval_not_null_tables(void *opt_arg); bool eval_not_null_tables(void *opt_arg) override;
bool find_not_null_fields(table_map allowed); bool find_not_null_fields(table_map allowed) override;
uint cols() const { return arg_count; } uint cols() const override { return arg_count; }
Item* element_index(uint i) { return args[i]; } Item* element_index(uint i) override { return args[i]; }
Item** addr(uint i) { return args + i; } Item** addr(uint i) override { return args + i; }
bool check_cols(uint c); bool check_cols(uint c) override;
bool null_inside() { return with_null; }; bool null_inside() override { return with_null; };
void bring_value(); void bring_value() override;
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_identity(), cond); Item_args::propagate_equal_fields(thd, Context_identity(), cond);
return this; 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); 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); 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); return Item_args::excl_dep_on_in_subq_left_part(subq_pred);
} }
bool check_vcol_func_processor(void *arg) {return FALSE; } 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_row>(thd, this); } { return get_item_copy<Item_row>(thd, this); }
Item *build_clone(THD *thd); Item *build_clone(THD *thd) override;
}; };
#endif /* ITEM_ROW_INCLUDED */ #endif /* ITEM_ROW_INCLUDED */
This diff is collapsed.
...@@ -304,29 +304,30 @@ class Item_singlerow_subselect :public Item_subselect ...@@ -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) Item_singlerow_subselect(THD *thd_arg): Item_subselect(thd_arg), value(0), row (0)
{} {}
void cleanup(); void cleanup() override;
subs_type substype() { return SINGLEROW_SUBS; } subs_type substype() override { return SINGLEROW_SUBS; }
void reset(); void reset() override;
void no_rows_in_result(); void no_rows_in_result() override;
bool select_transformer(JOIN *join); bool select_transformer(JOIN *join) override;
void store(uint i, Item* item); void store(uint i, Item* item);
double val_real(); double val_real() override;
longlong val_int (); longlong val_int() override;
String *val_str (String *); String *val_str(String *) override;
bool val_native(THD *thd, Native *); bool val_native(THD *thd, Native *) override;
my_decimal *val_decimal(my_decimal *); my_decimal *val_decimal(my_decimal *) override;
bool val_bool(); bool val_bool() override;
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;
const Type_handler *type_handler() const; const Type_handler *type_handler() const override;
bool fix_length_and_dec(); bool fix_length_and_dec() override;
uint cols() const; uint cols() const override;
Item* element_index(uint i) { return reinterpret_cast<Item*>(row[i]); } Item* element_index(uint i) override
Item** addr(uint i) { return (Item**)row + i; } { return reinterpret_cast<Item*>(row[i]); }
bool check_cols(uint c); Item** addr(uint i) override { return (Item**)row + i; }
bool null_inside(); bool check_cols(uint c) override;
void bring_value(); bool null_inside() override;
void bring_value() override;
/** /**
This method is used to implement a special case of semantic tree This method is used to implement a special case of semantic tree
...@@ -342,7 +343,7 @@ class Item_singlerow_subselect :public Item_subselect ...@@ -342,7 +343,7 @@ class Item_singlerow_subselect :public Item_subselect
*/ */
st_select_lex* invalidate_and_restore_select_lex(); 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; friend class select_singlerow_subselect;
}; };
...@@ -357,12 +358,12 @@ class Item_maxmin_subselect :public Item_singlerow_subselect ...@@ -357,12 +358,12 @@ class Item_maxmin_subselect :public Item_singlerow_subselect
public: public:
Item_maxmin_subselect(THD *thd, Item_subselect *parent, Item_maxmin_subselect(THD *thd, Item_subselect *parent,
st_select_lex *select_lex, bool max); st_select_lex *select_lex, bool max);
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
void cleanup(); void cleanup() override;
bool any_value() { return was_values; } bool any_value() { return was_values; }
void register_value() { was_values= TRUE; } void register_value() { was_values= TRUE; }
void reset_value_registration() { was_values= FALSE; } void reset_value_registration() override { was_values= FALSE; }
void no_rows_in_result(); void no_rows_in_result() override;
}; };
/* exists subselect */ /* exists subselect */
......
This diff is collapsed.
This diff is collapsed.
...@@ -33,12 +33,9 @@ class Item_func_history: public Item_bool_func ...@@ -33,12 +33,9 @@ class Item_func_history: public Item_bool_func
DBUG_ASSERT(a->type() == Item::FIELD_ITEM); DBUG_ASSERT(a->type() == Item::FIELD_ITEM);
} }
virtual bool val_bool(); bool val_bool() override;
virtual longlong val_int() longlong val_int() override { return val_bool(); }
{ bool fix_length_and_dec() override
return (val_bool() ? 1 : 0);
}
bool fix_length_and_dec()
{ {
set_maybe_null(); set_maybe_null();
null_value= 0; null_value= 0;
...@@ -46,13 +43,13 @@ class Item_func_history: public Item_bool_func ...@@ -46,13 +43,13 @@ class Item_func_history: public Item_bool_func
max_length= 1; max_length= 1;
return FALSE; 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") }; static LEX_CSTRING name= {STRING_WITH_LEN("is_history") };
return name; return name;
} }
virtual void print(String *str, enum_query_type query_type); void print(String *str, enum_query_type query_type) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_history>(thd, this); } { return get_item_copy<Item_func_history>(thd, this); }
}; };
...@@ -67,10 +64,10 @@ class Item_func_trt_ts: public Item_datetimefunc ...@@ -67,10 +64,10 @@ class Item_func_trt_ts: public Item_datetimefunc
static LEX_CSTRING commit_name= {STRING_WITH_LEN("trt_commit_ts") }; static LEX_CSTRING commit_name= {STRING_WITH_LEN("trt_commit_ts") };
return (trt_field == TR_table::FLD_BEGIN_TS) ? begin_name : commit_name; return (trt_field == TR_table::FLD_BEGIN_TS) ? begin_name : commit_name;
} }
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;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trt_ts>(thd, this); } { 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; } { fix_attributes_datetime(decimals); return FALSE; }
}; };
...@@ -105,15 +102,15 @@ class Item_func_trt_id : public Item_longlong_func ...@@ -105,15 +102,15 @@ class Item_func_trt_id : public Item_longlong_func
return NULL_clex_str; return NULL_clex_str;
} }
bool fix_length_and_dec() bool fix_length_and_dec() override
{ {
bool res= Item_int_func::fix_length_and_dec(); bool res= Item_int_func::fix_length_and_dec();
max_length= 20; max_length= 20;
return res; return res;
} }
longlong val_int(); longlong val_int() override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trt_id>(thd, this); } { return get_item_copy<Item_func_trt_id>(thd, this); }
}; };
...@@ -129,8 +126,8 @@ class Item_func_trt_trx_sees : public Item_bool_func ...@@ -129,8 +126,8 @@ class Item_func_trt_trx_sees : public Item_bool_func
static LEX_CSTRING name= {STRING_WITH_LEN("trt_trx_sees") }; static LEX_CSTRING name= {STRING_WITH_LEN("trt_trx_sees") };
return name; return name;
} }
longlong val_int(); longlong val_int() override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_trt_trx_sees>(thd, this); } { 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) 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 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 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 ...@@ -141,21 +141,21 @@ class Item_nodeset_func :public Item_str_func
fltend= (MY_XPATH_FLT*) tmp_native_value.end(); fltend= (MY_XPATH_FLT*) tmp_native_value.end();
nodeset->length(0); nodeset->length(0);
} }
const Type_handler *type_handler() const const Type_handler *type_handler() const override
{ {
return &type_handler_xpath_nodeset; 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; return &type_handler_xpath_nodeset;
} }
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, 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); DBUG_ASSERT(0);
return NULL; return NULL;
} }
String *val_str(String *str) String *val_str(String *str) override
{ {
prepare_nodes(); prepare_nodes();
val_native(current_thd, &tmp2_native_value); val_native(current_thd, &tmp2_native_value);
...@@ -189,7 +189,7 @@ class Item_nodeset_func :public Item_str_func ...@@ -189,7 +189,7 @@ class Item_nodeset_func :public Item_str_func
} }
return str; return str;
} }
bool fix_length_and_dec() bool fix_length_and_dec() override
{ {
max_length= MAX_BLOB_WIDTH; max_length= MAX_BLOB_WIDTH;
collation.collation= pxml->charset(); collation.collation= pxml->charset();
...@@ -202,7 +202,7 @@ class Item_nodeset_func :public Item_str_func ...@@ -202,7 +202,7 @@ class Item_nodeset_func :public Item_str_func
{ {
return { STRING_WITH_LEN("nodeset") }; 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); return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE);
} }
...@@ -220,8 +220,8 @@ class Item_nodeset_func_rootelement :public Item_nodeset_func ...@@ -220,8 +220,8 @@ class Item_nodeset_func_rootelement :public Item_nodeset_func
{ {
return { STRING_WITH_LEN("xpath_rootelement") }; return { STRING_WITH_LEN("xpath_rootelement") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_rootelement>(thd, this); } { return get_item_copy<Item_nodeset_func_rootelement>(thd, this); }
}; };
...@@ -236,8 +236,8 @@ class Item_nodeset_func_union :public Item_nodeset_func ...@@ -236,8 +236,8 @@ class Item_nodeset_func_union :public Item_nodeset_func
{ {
return { STRING_WITH_LEN("xpath_union") }; return { STRING_WITH_LEN("xpath_union") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_union>(thd, this); } { return get_item_copy<Item_nodeset_func_union>(thd, this); }
}; };
...@@ -276,8 +276,8 @@ class Item_nodeset_func_selfbyname: public Item_nodeset_func_axisbyname ...@@ -276,8 +276,8 @@ class Item_nodeset_func_selfbyname: public Item_nodeset_func_axisbyname
{ {
return { STRING_WITH_LEN("xpath_selfbyname") }; return { STRING_WITH_LEN("xpath_selfbyname") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_selfbyname>(thd, this); } { return get_item_copy<Item_nodeset_func_selfbyname>(thd, this); }
}; };
...@@ -293,8 +293,8 @@ class Item_nodeset_func_childbyname: public Item_nodeset_func_axisbyname ...@@ -293,8 +293,8 @@ class Item_nodeset_func_childbyname: public Item_nodeset_func_axisbyname
{ {
return { STRING_WITH_LEN("xpath_childbyname") }; return { STRING_WITH_LEN("xpath_childbyname") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_childbyname>(thd, this); } { return get_item_copy<Item_nodeset_func_childbyname>(thd, this); }
}; };
...@@ -312,8 +312,8 @@ class Item_nodeset_func_descendantbyname: public Item_nodeset_func_axisbyname ...@@ -312,8 +312,8 @@ class Item_nodeset_func_descendantbyname: public Item_nodeset_func_axisbyname
{ {
return { STRING_WITH_LEN("xpath_descendantbyname") }; return { STRING_WITH_LEN("xpath_descendantbyname") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_descendantbyname>(thd, this); } { return get_item_copy<Item_nodeset_func_descendantbyname>(thd, this); }
}; };
...@@ -331,8 +331,8 @@ class Item_nodeset_func_ancestorbyname: public Item_nodeset_func_axisbyname ...@@ -331,8 +331,8 @@ class Item_nodeset_func_ancestorbyname: public Item_nodeset_func_axisbyname
{ {
return { STRING_WITH_LEN("xpath_ancestorbyname") }; return { STRING_WITH_LEN("xpath_ancestorbyname") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_ancestorbyname>(thd, this); } { return get_item_copy<Item_nodeset_func_ancestorbyname>(thd, this); }
}; };
...@@ -349,8 +349,8 @@ class Item_nodeset_func_parentbyname: public Item_nodeset_func_axisbyname ...@@ -349,8 +349,8 @@ class Item_nodeset_func_parentbyname: public Item_nodeset_func_axisbyname
{ {
return { STRING_WITH_LEN("xpath_parentbyname") }; return { STRING_WITH_LEN("xpath_parentbyname") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_parentbyname>(thd, this); } { return get_item_copy<Item_nodeset_func_parentbyname>(thd, this); }
}; };
...@@ -366,8 +366,8 @@ class Item_nodeset_func_attributebyname: public Item_nodeset_func_axisbyname ...@@ -366,8 +366,8 @@ class Item_nodeset_func_attributebyname: public Item_nodeset_func_axisbyname
{ {
return { STRING_WITH_LEN("xpath_attributebyname") }; return { STRING_WITH_LEN("xpath_attributebyname") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_attributebyname>(thd, this); } { return get_item_copy<Item_nodeset_func_attributebyname>(thd, this); }
}; };
...@@ -386,8 +386,8 @@ class Item_nodeset_func_predicate :public Item_nodeset_func ...@@ -386,8 +386,8 @@ class Item_nodeset_func_predicate :public Item_nodeset_func
{ {
return { STRING_WITH_LEN("xpath_predicate") }; return { STRING_WITH_LEN("xpath_predicate") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_predicate>(thd, this); } { return get_item_copy<Item_nodeset_func_predicate>(thd, this); }
}; };
...@@ -402,8 +402,8 @@ class Item_nodeset_func_elementbyindex :public Item_nodeset_func ...@@ -402,8 +402,8 @@ class Item_nodeset_func_elementbyindex :public Item_nodeset_func
{ {
return { STRING_WITH_LEN("xpath_elementbyindex") }; return { STRING_WITH_LEN("xpath_elementbyindex") };
} }
bool val_native(THD *thd, Native *nodeset); bool val_native(THD *thd, Native *nodeset) override;
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_func_elementbyindex>(thd, this); } { return get_item_copy<Item_nodeset_func_elementbyindex>(thd, this); }
}; };
...@@ -425,7 +425,7 @@ class Item_xpath_cast_bool :public Item_bool_func ...@@ -425,7 +425,7 @@ class Item_xpath_cast_bool :public Item_bool_func
{ {
return { STRING_WITH_LEN("xpath_cast_bool") }; return { STRING_WITH_LEN("xpath_cast_bool") };
} }
longlong val_int() longlong val_int() override
{ {
if (args[0]->fixed_type_handler() == &type_handler_xpath_nodeset) if (args[0]->fixed_type_handler() == &type_handler_xpath_nodeset)
{ {
...@@ -434,7 +434,7 @@ class Item_xpath_cast_bool :public Item_bool_func ...@@ -434,7 +434,7 @@ class Item_xpath_cast_bool :public Item_bool_func
} }
return args[0]->val_real() ? 1 : 0; 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); } { return get_item_copy<Item_xpath_cast_bool>(thd, this); }
}; };
...@@ -450,8 +450,8 @@ class Item_xpath_cast_number :public Item_real_func ...@@ -450,8 +450,8 @@ class Item_xpath_cast_number :public Item_real_func
{ {
return { STRING_WITH_LEN("xpath_cast_number") }; return { STRING_WITH_LEN("xpath_cast_number") };
} }
virtual double val_real() { return args[0]->val_real(); } double val_real() override { return args[0]->val_real(); }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_xpath_cast_number>(thd, this); } { return get_item_copy<Item_xpath_cast_number>(thd, this); }
}; };
...@@ -465,12 +465,13 @@ class Item_nodeset_context_cache :public Item_nodeset_func ...@@ -465,12 +465,13 @@ class Item_nodeset_context_cache :public Item_nodeset_func
Native *native_cache; Native *native_cache;
Item_nodeset_context_cache(THD *thd, Native *native_arg, String *pxml): Item_nodeset_context_cache(THD *thd, Native *native_arg, String *pxml):
Item_nodeset_func(thd, pxml), native_cache(native_arg) { } 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); return nodeset->copy(*native_cache);
} }
bool fix_length_and_dec() { max_length= MAX_BLOB_WIDTH;; return FALSE; } bool fix_length_and_dec() override
Item *get_copy(THD *thd) { max_length= MAX_BLOB_WIDTH; return FALSE; }
Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_context_cache>(thd, this); } { return get_item_copy<Item_nodeset_context_cache>(thd, this); }
}; };
...@@ -486,15 +487,15 @@ class Item_func_xpath_position :public Item_long_func ...@@ -486,15 +487,15 @@ class Item_func_xpath_position :public Item_long_func
{ {
return { STRING_WITH_LEN("xpath_position") }; return { STRING_WITH_LEN("xpath_position") };
} }
bool fix_length_and_dec() { max_length=10; return FALSE; } bool fix_length_and_dec() override { max_length=10; return FALSE; }
longlong val_int() longlong val_int() override
{ {
args[0]->val_native(current_thd, &tmp_native_value); args[0]->val_native(current_thd, &tmp_native_value);
if (tmp_native_value.elements() == 1) if (tmp_native_value.elements() == 1)
return tmp_native_value.element(0).pos + 1; return tmp_native_value.element(0).pos + 1;
return 0; return 0;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xpath_position>(thd, this); } { return get_item_copy<Item_func_xpath_position>(thd, this); }
}; };
...@@ -510,8 +511,8 @@ class Item_func_xpath_count :public Item_long_func ...@@ -510,8 +511,8 @@ class Item_func_xpath_count :public Item_long_func
{ {
return { STRING_WITH_LEN("xpath_count") }; return { STRING_WITH_LEN("xpath_count") };
} }
bool fix_length_and_dec() { max_length=10; return FALSE; } bool fix_length_and_dec() override { max_length=10; return FALSE; }
longlong val_int() longlong val_int() override
{ {
uint predicate_supplied_context_size; uint predicate_supplied_context_size;
args[0]->val_native(current_thd, &tmp_native_value); args[0]->val_native(current_thd, &tmp_native_value);
...@@ -520,7 +521,7 @@ class Item_func_xpath_count :public Item_long_func ...@@ -520,7 +521,7 @@ class Item_func_xpath_count :public Item_long_func
return predicate_supplied_context_size; return predicate_supplied_context_size;
return tmp_native_value.elements(); 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); } { return get_item_copy<Item_func_xpath_count>(thd, this); }
}; };
...@@ -537,7 +538,7 @@ class Item_func_xpath_sum :public Item_real_func ...@@ -537,7 +538,7 @@ class Item_func_xpath_sum :public Item_real_func
{ {
return { STRING_WITH_LEN("xpath_sum") }; return { STRING_WITH_LEN("xpath_sum") };
} }
double val_real() double val_real() override
{ {
double sum= 0; double sum= 0;
args[0]->val_native(current_thd, &tmp_native_value); args[0]->val_native(current_thd, &tmp_native_value);
...@@ -568,7 +569,7 @@ class Item_func_xpath_sum :public Item_real_func ...@@ -568,7 +569,7 @@ class Item_func_xpath_sum :public Item_real_func
} }
return sum; return sum;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_func_xpath_sum>(thd, this); } { return get_item_copy<Item_func_xpath_sum>(thd, this); }
}; };
...@@ -612,17 +613,17 @@ class Item_nodeset_to_const_comparator :public Item_bool_func ...@@ -612,17 +613,17 @@ class Item_nodeset_to_const_comparator :public Item_bool_func
{ {
return { STRING_WITH_LEN("xpath_nodeset_to_const_comparator") }; 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); return mark_unsupported_function(func_name(), arg, VCOL_IMPOSSIBLE);
} }
Field *create_tmp_field_ex(MEM_ROOT *root, TABLE *table, Tmp_field_src *src, 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); DBUG_ASSERT(0);
return NULL; return NULL;
} }
longlong val_int() longlong val_int() override
{ {
Item_func *comp= (Item_func*)args[1]; Item_func *comp= (Item_func*)args[1];
Item_string_xml_non_const *fake= Item_string_xml_non_const *fake=
...@@ -653,7 +654,7 @@ class Item_nodeset_to_const_comparator :public Item_bool_func ...@@ -653,7 +654,7 @@ class Item_nodeset_to_const_comparator :public Item_bool_func
} }
return 0; return 0;
} }
Item *get_copy(THD *thd) Item *get_copy(THD *thd) override
{ return get_item_copy<Item_nodeset_to_const_comparator>(thd, this); } { 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 ...@@ -60,7 +60,8 @@ class sp_variable : public Sql_alloc
Spvar_definition field_def; Spvar_definition field_def;
/// Field-type of the SP-variable. /// 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: public:
sp_variable(const LEX_CSTRING *name_arg, uint offset_arg) sp_variable(const LEX_CSTRING *name_arg, uint offset_arg)
......
...@@ -6985,7 +6985,8 @@ class my_var_sp: public my_var { ...@@ -6985,7 +6985,8 @@ class my_var_sp: public my_var {
~my_var_sp() { } ~my_var_sp() { }
bool set(THD *thd, Item *val); bool set(THD *thd, Item *val);
my_var_sp *get_my_var_sp() { return this; } 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; 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