Commit 58e759a9 authored by Michael Widenius's avatar Michael Widenius Committed by Oleksandr Byelkin

Added 'final' to some classes to improve generated code

Final added to:
- All reasonable classes inhereted from Field
- All classes inhereted from Protocol
- Almost all Handler classes
- Some important Item classes

The stripped size of mariadbd is just 4K smaller, but several object files
showed notable improvements in common execution paths.
- Checked field.o and item_sum.o

Other things:
- Added 'override' to a few class functions touched by this patch.
- Removed 'virtual' from a new class functions that had/got 'override'
- Changed Protocol_discard to inherit from Protocol instad of Protocol_text
parent 48b5777e
...@@ -2274,7 +2274,7 @@ class Field_real :public Field_num { ...@@ -2274,7 +2274,7 @@ class Field_real :public Field_num {
}; };
class Field_decimal :public Field_real { class Field_decimal final :public Field_real {
public: public:
Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
...@@ -2320,7 +2320,7 @@ class Field_decimal :public Field_real { ...@@ -2320,7 +2320,7 @@ class Field_decimal :public Field_real {
/* New decimal/numeric field which use fixed point arithmetic */ /* New decimal/numeric field which use fixed point arithmetic */
class Field_new_decimal :public Field_num { class Field_new_decimal final :public Field_num {
public: public:
/* The maximum number of decimal digits can be stored */ /* The maximum number of decimal digits can be stored */
uint precision; uint precision;
...@@ -2550,7 +2550,7 @@ class Field_tiny :public Field_int ...@@ -2550,7 +2550,7 @@ class Field_tiny :public Field_int
}; };
class Field_short :public Field_int class Field_short final :public Field_int
{ {
const Type_handler_general_purpose_int *type_handler_priv() const const Type_handler_general_purpose_int *type_handler_priv() const
{ {
...@@ -2603,7 +2603,7 @@ class Field_short :public Field_int ...@@ -2603,7 +2603,7 @@ class Field_short :public Field_int
} }
}; };
class Field_medium :public Field_int class Field_medium final :public Field_int
{ {
const Type_handler_general_purpose_int *type_handler_priv() const const Type_handler_general_purpose_int *type_handler_priv() const
{ {
...@@ -2649,7 +2649,7 @@ class Field_medium :public Field_int ...@@ -2649,7 +2649,7 @@ class Field_medium :public Field_int
}; };
class Field_long :public Field_int class Field_long final :public Field_int
{ {
const Type_handler_general_purpose_int *type_handler_priv() const const Type_handler_general_purpose_int *type_handler_priv() const
{ {
...@@ -2812,7 +2812,7 @@ class Field_vers_trx_id :public Field_longlong { ...@@ -2812,7 +2812,7 @@ class Field_vers_trx_id :public Field_longlong {
}; };
class Field_float :public Field_real { class Field_float final :public Field_real {
public: public:
Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
...@@ -2898,28 +2898,28 @@ class Field_double :public Field_real { ...@@ -2898,28 +2898,28 @@ class Field_double :public Field_real {
} }
const Type_handler *type_handler() const override const Type_handler *type_handler() const override
{ return &type_handler_double; } { return &type_handler_double; }
enum ha_base_keytype key_type() const override { return HA_KEYTYPE_DOUBLE; } enum ha_base_keytype key_type() const override final { return HA_KEYTYPE_DOUBLE; }
int store(const char *to,size_t length,CHARSET_INFO *charset) override; int store(const char *to,size_t length,CHARSET_INFO *charset) override final;
int store(double nr) override; int store(double nr) override final;
int store(longlong nr, bool unsigned_val) override; int store(longlong nr, bool unsigned_val) override final;
int reset() override { bzero(ptr,sizeof(double)); return 0; } int reset() override final { bzero(ptr,sizeof(double)); return 0; }
double val_real() override; double val_real() override final;
longlong val_int() override { return val_int_from_real(false); } longlong val_int() override final { return val_int_from_real(false); }
ulonglong val_uint() override { return (ulonglong) val_int_from_real(true); } ulonglong val_uint() override final { return (ulonglong) val_int_from_real(true); }
String *val_str(String *, String *) override; String *val_str(String *, String *) override final;
bool send_binary(Protocol *protocol) override; bool send_binary(Protocol *protocol) override final;
int cmp(const uchar *,const uchar *) const override; int cmp(const uchar *,const uchar *) const override final;
void sort_string(uchar *buff, uint length) override; void sort_string(uchar *buff, uint length) override final;
uint32 pack_length() const override { return sizeof(double); } uint32 pack_length() const override final { return sizeof(double); }
uint row_pack_length() const override { return pack_length(); } uint row_pack_length() const override final { return pack_length(); }
ulonglong get_max_int_value() const override ulonglong get_max_int_value() const override final
{ {
/* /*
We use the maximum as per IEEE754-2008 standard, 2^53 We use the maximum as per IEEE754-2008 standard, 2^53
*/ */
return 0x20000000000000ULL; return 0x20000000000000ULL;
} }
Binlog_type_info binlog_type_info() const override; Binlog_type_info binlog_type_info() const override final;
}; };
...@@ -2948,40 +2948,40 @@ class Field_null :public Field_str { ...@@ -2948,40 +2948,40 @@ class Field_null :public Field_str {
{ {
return do_field_string; return do_field_string;
} }
int store(const char *to, size_t length, CHARSET_INFO *cs) override int store(const char *to, size_t length, CHARSET_INFO *cs) override final
{ null[0]=1; return 0; } { null[0]=1; return 0; }
int store(double nr) override { null[0]=1; return 0; } int store(double nr) override final { null[0]=1; return 0; }
int store(longlong nr, bool unsigned_val) override { null[0]=1; return 0; } int store(longlong nr, bool unsigned_val) override final { null[0]=1; return 0; }
int store_decimal(const my_decimal *d) override { null[0]=1; return 0; } int store_decimal(const my_decimal *d) override final { null[0]=1; return 0; }
int reset() override { return 0; } int reset() override final { return 0; }
double val_real() override { return 0.0;} double val_real() override final { return 0.0;}
longlong val_int() override { return 0;} longlong val_int() override final { return 0;}
bool val_bool() override { return false; } bool val_bool() override final { return false; }
my_decimal *val_decimal(my_decimal *) override { return 0; } my_decimal *val_decimal(my_decimal *) override final { return 0; }
String *val_str(String *value,String *value2) override String *val_str(String *value,String *value2) override final
{ value2->length(0); return value2;} { value2->length(0); return value2;}
bool is_equal(const Column_definition &new_field) const override; bool is_equal(const Column_definition &new_field) const override final;
int cmp(const uchar *a, const uchar *b) const override { return 0;} int cmp(const uchar *a, const uchar *b) const override final { return 0;}
void sort_string(uchar *buff, uint length) override {} void sort_string(uchar *buff, uint length) override final {}
uint32 pack_length() const override { return 0; } uint32 pack_length() const override final { return 0; }
void sql_type(String &str) const override; void sql_type(String &str) const override final;
uint size_of() const override { return sizeof *this; } uint size_of() const override final { return sizeof *this; }
uint32 max_display_length() const override { return 4; } uint32 max_display_length() const override final { return 4; }
void move_field_offset(my_ptrdiff_t ptr_diff) override {} void move_field_offset(my_ptrdiff_t ptr_diff) override final {}
bool can_optimize_keypart_ref(const Item_bool_func *cond, bool can_optimize_keypart_ref(const Item_bool_func *cond,
const Item *item) const override const Item *item) const override final
{ {
return false; return false;
} }
bool can_optimize_group_min_max(const Item_bool_func *cond, bool can_optimize_group_min_max(const Item_bool_func *cond,
const Item *const_item) const override const Item *const_item) const override final
{ {
return false; return false;
} }
}; };
class Field_temporal: public Field { class Field_temporal :public Field {
protected: protected:
Item *get_equal_const_item_datetime(THD *thd, const Context &ctx, Item *get_equal_const_item_datetime(THD *thd, const Context &ctx,
Item *const_item); Item *const_item);
...@@ -3098,7 +3098,7 @@ class Field_temporal: public Field { ...@@ -3098,7 +3098,7 @@ class Field_temporal: public Field {
- DATETIME(1..6) - DATETIME(1..6)
- DATETIME(0..6) - MySQL56 version - DATETIME(0..6) - MySQL56 version
*/ */
class Field_temporal_with_date: public Field_temporal { class Field_temporal_with_date :public Field_temporal {
protected: protected:
virtual void store_TIME(const MYSQL_TIME *ltime) = 0; virtual void store_TIME(const MYSQL_TIME *ltime) = 0;
void store_datetime(const Datetime &dt) void store_datetime(const Datetime &dt)
...@@ -3305,7 +3305,7 @@ class Field_timestamp_hires :public Field_timestamp_with_dec { ...@@ -3305,7 +3305,7 @@ class Field_timestamp_hires :public Field_timestamp_with_dec {
/** /**
TIMESTAMP(0..6) - MySQL56 version TIMESTAMP(0..6) - MySQL56 version
*/ */
class Field_timestampf :public Field_timestamp_with_dec { class Field_timestampf final :public Field_timestamp_with_dec {
void store_TIMEVAL(const timeval &tv) override; void store_TIMEVAL(const timeval &tv) override;
public: public:
Field_timestampf(uchar *ptr_arg, Field_timestampf(uchar *ptr_arg,
...@@ -3353,7 +3353,7 @@ class Field_timestampf :public Field_timestamp_with_dec { ...@@ -3353,7 +3353,7 @@ class Field_timestampf :public Field_timestamp_with_dec {
}; };
class Field_year :public Field_tiny { class Field_year final :public Field_tiny {
public: public:
Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
...@@ -3414,7 +3414,7 @@ class Field_year :public Field_tiny { ...@@ -3414,7 +3414,7 @@ class Field_year :public Field_tiny {
}; };
class Field_date_common: public Field_temporal_with_date class Field_date_common :public Field_temporal_with_date
{ {
protected: protected:
int store_TIME_with_warning(const Datetime *ltime, const ErrConv *str, int store_TIME_with_warning(const Datetime *ltime, const ErrConv *str,
...@@ -3439,7 +3439,7 @@ class Field_date_common: public Field_temporal_with_date ...@@ -3439,7 +3439,7 @@ class Field_date_common: public Field_temporal_with_date
}; };
class Field_date :public Field_date_common class Field_date final :public Field_date_common
{ {
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate) bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
...@@ -3480,7 +3480,7 @@ class Field_date :public Field_date_common ...@@ -3480,7 +3480,7 @@ class Field_date :public Field_date_common
}; };
class Field_newdate :public Field_date_common class Field_newdate final :public Field_date_common
{ {
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate) bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
...@@ -3571,7 +3571,7 @@ class Field_time :public Field_temporal { ...@@ -3571,7 +3571,7 @@ class Field_time :public Field_temporal {
}; };
class Field_time0: public Field_time class Field_time0 final :public Field_time
{ {
protected: protected:
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
...@@ -3628,7 +3628,7 @@ class Field_time_with_dec :public Field_time { ...@@ -3628,7 +3628,7 @@ class Field_time_with_dec :public Field_time {
/** /**
TIME(1..6) TIME(1..6)
*/ */
class Field_time_hires :public Field_time_with_dec { class Field_time_hires final :public Field_time_with_dec {
longlong zero_point; longlong zero_point;
void store_TIME(const MYSQL_TIME *) override; void store_TIME(const MYSQL_TIME *) override;
public: public:
...@@ -3661,7 +3661,7 @@ class Field_time_hires :public Field_time_with_dec { ...@@ -3661,7 +3661,7 @@ class Field_time_hires :public Field_time_with_dec {
/** /**
TIME(0..6) - MySQL56 version TIME(0..6) - MySQL56 version
*/ */
class Field_timef :public Field_time_with_dec { class Field_timef final :public Field_time_with_dec {
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
public: public:
Field_timef(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, Field_timef(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
...@@ -3746,7 +3746,11 @@ class Field_datetime :public Field_temporal_with_date { ...@@ -3746,7 +3746,11 @@ class Field_datetime :public Field_temporal_with_date {
}; };
class Field_datetime0 :public Field_datetime /*
Stored as a 8 byte unsigned int. Should sometimes be change to a 6 byte
*/
class Field_datetime0 final :public Field_datetime
{ {
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate) bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
...@@ -3808,30 +3812,30 @@ class Field_datetime_with_dec :public Field_datetime { ...@@ -3808,30 +3812,30 @@ class Field_datetime_with_dec :public Field_datetime {
{ {
DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS); DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
} }
uint decimals() const override { return dec; } uint decimals() const override final { return dec; }
enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; } enum ha_base_keytype key_type() const override final { return HA_KEYTYPE_BINARY; }
void make_send_field(Send_field *field) override; void make_send_field(Send_field *field) override final;
bool send_binary(Protocol *protocol) override; bool send_binary(Protocol *protocol) override final;
uchar *pack(uchar *to, const uchar *from, uint max_length) override uchar *pack(uchar *to, const uchar *from, uint max_length) override final
{ return Field::pack(to, from, max_length); } { return Field::pack(to, from, max_length); }
const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end, const uchar *unpack(uchar* to, const uchar *from, const uchar *from_end,
uint param_data) override uint param_data) override final
{ return Field::unpack(to, from, from_end, param_data); } { return Field::unpack(to, from, from_end, param_data); }
void sort_string(uchar *to, uint length) override void sort_string(uchar *to, uint length) override final
{ {
DBUG_ASSERT(length == pack_length()); DBUG_ASSERT(length == pack_length());
memcpy(to, ptr, length); memcpy(to, ptr, length);
} }
double val_real() override; double val_real() override final;
longlong val_int() override; longlong val_int() override final;
String *val_str(String *, String *) override; String *val_str(String *, String *) override final;
}; };
/** /**
DATETIME(1..6) DATETIME(1..6)
*/ */
class Field_datetime_hires :public Field_datetime_with_dec { class Field_datetime_hires final :public Field_datetime_with_dec {
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate) bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
const override; const override;
...@@ -3861,7 +3865,8 @@ class Field_datetime_hires :public Field_datetime_with_dec { ...@@ -3861,7 +3865,8 @@ class Field_datetime_hires :public Field_datetime_with_dec {
/** /**
DATETIME(0..6) - MySQL56 version DATETIME(0..6) - MySQL56 version
*/ */
class Field_datetimef :public Field_datetime_with_dec {
class Field_datetimef final :public Field_datetime_with_dec {
void store_TIME(const MYSQL_TIME *ltime) override; void store_TIME(const MYSQL_TIME *ltime) override;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate) bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
const override; const override;
...@@ -3955,7 +3960,7 @@ new_Field_datetime(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit, ...@@ -3955,7 +3960,7 @@ new_Field_datetime(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit,
unireg_check, field_name, dec); unireg_check, field_name, dec);
} }
class Field_string :public Field_longstr { class Field_string final :public Field_longstr {
class Warn_filter_string: public Warn_filter class Warn_filter_string: public Warn_filter
{ {
public: public:
...@@ -4188,7 +4193,7 @@ class Field_varstring :public Field_longstr { ...@@ -4188,7 +4193,7 @@ class Field_varstring :public Field_longstr {
}; };
class Field_varstring_compressed: public Field_varstring { class Field_varstring_compressed final :public Field_varstring {
public: public:
Field_varstring_compressed(uchar *ptr_arg, Field_varstring_compressed(uchar *ptr_arg,
uint32 len_arg, uint length_bytes_arg, uint32 len_arg, uint length_bytes_arg,
...@@ -4590,7 +4595,7 @@ class Field_blob :public Field_longstr { ...@@ -4590,7 +4595,7 @@ class Field_blob :public Field_longstr {
}; };
class Field_blob_compressed: public Field_blob { class Field_blob_compressed final :public Field_blob {
public: public:
Field_blob_compressed(uchar *ptr_arg, uchar *null_ptr_arg, Field_blob_compressed(uchar *ptr_arg, uchar *null_ptr_arg,
uchar null_bit_arg, enum utype unireg_check_arg, uchar null_bit_arg, enum utype unireg_check_arg,
...@@ -4756,7 +4761,7 @@ class Field_enum :public Field_str { ...@@ -4756,7 +4761,7 @@ class Field_enum :public Field_str {
}; };
class Field_set :public Field_enum { class Field_set final :public Field_enum {
public: public:
Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
...@@ -5005,7 +5010,7 @@ class Field_bit :public Field { ...@@ -5005,7 +5010,7 @@ class Field_bit :public Field {
an extended version of Field_bit_as_char and not the other way an extended version of Field_bit_as_char and not the other way
around. Hence, we should refactor it to fix the hierarchy order. around. Hence, we should refactor it to fix the hierarchy order.
*/ */
class Field_bit_as_char: public Field_bit { class Field_bit_as_char final :public Field_bit {
public: public:
Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, uchar null_bit_arg,
...@@ -5020,7 +5025,7 @@ class Field_bit_as_char: public Field_bit { ...@@ -5020,7 +5025,7 @@ class Field_bit_as_char: public Field_bit {
}; };
class Field_row: public Field_null class Field_row final :public Field_null
{ {
class Virtual_tmp_table *m_table; class Virtual_tmp_table *m_table;
public: public:
......
...@@ -2157,7 +2157,7 @@ class Item_aggregate_ref : public Item_ref ...@@ -2157,7 +2157,7 @@ class Item_aggregate_ref : public Item_ref
const LEX_CSTRING &field_name_arg): const LEX_CSTRING &field_name_arg):
Item_ref(thd, context_arg, item, table_name_arg, field_name_arg) {} Item_ref(thd, context_arg, item, table_name_arg, field_name_arg) {}
virtual inline void print (String *str, enum_query_type query_type) void print (String *str, enum_query_type query_type) override
{ {
if (ref) if (ref)
(*ref)->print(str, query_type); (*ref)->print(str, query_type);
......
...@@ -744,7 +744,7 @@ class Item_func_eq :public Item_bool_rowready_func2 ...@@ -744,7 +744,7 @@ class Item_func_eq :public Item_bool_rowready_func2
{ return get_item_copy<Item_func_eq>(thd, this); } { return get_item_copy<Item_func_eq>(thd, this); }
}; };
class Item_func_equal :public Item_bool_rowready_func2 class Item_func_equal final :public Item_bool_rowready_func2
{ {
public: public:
Item_func_equal(THD *thd, Item *a, Item *b): Item_func_equal(THD *thd, Item *a, Item *b):
...@@ -3331,7 +3331,7 @@ class Item_equal_fields_iterator_slow ...@@ -3331,7 +3331,7 @@ class Item_equal_fields_iterator_slow
}; };
class Item_cond_and :public Item_cond class Item_cond_and final :public Item_cond
{ {
public: public:
COND_EQUAL m_cond_equal; /* contains list of Item_equal objects for COND_EQUAL m_cond_equal; /* contains list of Item_equal objects for
...@@ -3368,7 +3368,7 @@ inline bool is_cond_and(Item *item) ...@@ -3368,7 +3368,7 @@ inline bool is_cond_and(Item *item)
return func_item && func_item->functype() == Item_func::COND_AND_FUNC; return func_item && func_item->functype() == Item_func::COND_AND_FUNC;
} }
class Item_cond_or :public Item_cond class Item_cond_or final :public Item_cond
{ {
public: public:
Item_cond_or(THD *thd): Item_cond(thd) {} Item_cond_or(THD *thd): Item_cond(thd) {}
......
...@@ -1016,7 +1016,7 @@ class Stddev ...@@ -1016,7 +1016,7 @@ class Stddev
class Item_sum_variance : public Item_sum_double class Item_sum_variance :public Item_sum_double
{ {
Stddev m_stddev; Stddev m_stddev;
bool fix_length_and_dec(); bool fix_length_and_dec();
...@@ -1033,13 +1033,13 @@ class Item_sum_variance : public Item_sum_double ...@@ -1033,13 +1033,13 @@ class Item_sum_variance : public Item_sum_double
enum Sumfunctype sum_func () const { return VARIANCE_FUNC; } enum Sumfunctype sum_func () const { return VARIANCE_FUNC; }
void fix_length_and_dec_double(); void fix_length_and_dec_double();
void fix_length_and_dec_decimal(); void fix_length_and_dec_decimal();
void clear(); void clear() override final;
bool add(); bool add() override final;
double val_real(); double val_real();
void reset_field(); void reset_field() override final;
void update_field(); void update_field() override final;
Item *result_item(THD *thd, Field *field); Item *result_item(THD *thd, Field *field);
void no_rows_in_result() {} void no_rows_in_result() override final {}
const char *func_name() const const char *func_name() const
{ return sample ? "var_samp(" : "variance("; } { return sample ? "var_samp(" : "variance("; }
Item *copy_or_same(THD* thd); Item *copy_or_same(THD* thd);
...@@ -1057,7 +1057,7 @@ class Item_sum_variance : public Item_sum_double ...@@ -1057,7 +1057,7 @@ class Item_sum_variance : public Item_sum_double
standard_deviation(a) = sqrt(variance(a)) standard_deviation(a) = sqrt(variance(a))
*/ */
class Item_sum_std :public Item_sum_variance class Item_sum_std final :public Item_sum_variance
{ {
public: public:
Item_sum_std(THD *thd, Item *item_par, uint sample_arg): Item_sum_std(THD *thd, Item *item_par, uint sample_arg):
...@@ -1075,7 +1075,7 @@ class Item_sum_std :public Item_sum_variance ...@@ -1075,7 +1075,7 @@ class Item_sum_std :public Item_sum_variance
}; };
class Item_sum_hybrid: public Item_sum, class Item_sum_hybrid : public Item_sum,
public Type_handler_hybrid_field_type public Type_handler_hybrid_field_type
{ {
public: public:
...@@ -1156,7 +1156,7 @@ class Item_sum_min_max :public Item_sum_hybrid ...@@ -1156,7 +1156,7 @@ class Item_sum_min_max :public Item_sum_hybrid
}; };
class Item_sum_min :public Item_sum_min_max class Item_sum_min final :public Item_sum_min_max
{ {
public: public:
Item_sum_min(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, 1) {} Item_sum_min(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, 1) {}
...@@ -1171,7 +1171,7 @@ class Item_sum_min :public Item_sum_min_max ...@@ -1171,7 +1171,7 @@ class Item_sum_min :public Item_sum_min_max
}; };
class Item_sum_max :public Item_sum_min_max class Item_sum_max final :public Item_sum_min_max
{ {
public: public:
Item_sum_max(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, -1) {} Item_sum_max(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, -1) {}
...@@ -1260,7 +1260,7 @@ class Item_sum_bit :public Item_sum_int ...@@ -1260,7 +1260,7 @@ class Item_sum_bit :public Item_sum_int
}; };
class Item_sum_or :public Item_sum_bit class Item_sum_or final :public Item_sum_bit
{ {
public: public:
Item_sum_or(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {} Item_sum_or(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
...@@ -1276,7 +1276,7 @@ class Item_sum_or :public Item_sum_bit ...@@ -1276,7 +1276,7 @@ class Item_sum_or :public Item_sum_bit
}; };
class Item_sum_and :public Item_sum_bit class Item_sum_and final :public Item_sum_bit
{ {
public: public:
Item_sum_and(THD *thd, Item *item_par): Item_sum_and(THD *thd, Item *item_par):
...@@ -1292,7 +1292,7 @@ class Item_sum_and :public Item_sum_bit ...@@ -1292,7 +1292,7 @@ class Item_sum_and :public Item_sum_bit
void set_bits_from_counters(); void set_bits_from_counters();
}; };
class Item_sum_xor :public Item_sum_bit class Item_sum_xor final :public Item_sum_bit
{ {
public: public:
Item_sum_xor(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {} Item_sum_xor(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
...@@ -1359,7 +1359,7 @@ struct st_sp_security_context; ...@@ -1359,7 +1359,7 @@ struct st_sp_security_context;
Example: Example:
DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN ret_val; DECLARE CONTINUE HANDLER FOR NOT FOUND RETURN ret_val;
*/ */
class Item_sum_sp :public Item_sum, class Item_sum_sp final :public Item_sum,
public Item_sp public Item_sp
{ {
private: private:
......
...@@ -190,7 +190,8 @@ class Protocol ...@@ -190,7 +190,8 @@ class Protocol
Before adding a new type, please make sure Before adding a new type, please make sure
there is enough storage for it in Query_cache_query_flags. there is enough storage for it in Query_cache_query_flags.
*/ */
PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1, PROTOCOL_LOCAL= 2 PROTOCOL_TEXT= 0, PROTOCOL_BINARY= 1, PROTOCOL_LOCAL= 2,
PROTOCOL_DISCARD= 3 /* Should be last, not used by Query_cache */
}; };
virtual enum enum_protocol_type type()= 0; virtual enum enum_protocol_type type()= 0;
...@@ -204,7 +205,7 @@ class Protocol ...@@ -204,7 +205,7 @@ class Protocol
/** Class used for the old (MySQL 4.0 protocol). */ /** Class used for the old (MySQL 4.0 protocol). */
class Protocol_text :public Protocol class Protocol_text final :public Protocol
{ {
public: public:
Protocol_text(THD *thd_arg, ulong prealloc= 0) Protocol_text(THD *thd_arg, ulong prealloc= 0)
...@@ -242,11 +243,11 @@ class Protocol_text :public Protocol ...@@ -242,11 +243,11 @@ class Protocol_text :public Protocol
bool store_field_metadata_for_list_fields(const THD *thd, Field *field, bool store_field_metadata_for_list_fields(const THD *thd, Field *field,
const TABLE_LIST *table_list, const TABLE_LIST *table_list,
uint pos); uint pos);
virtual enum enum_protocol_type type() { return PROTOCOL_TEXT; }; enum enum_protocol_type type() override { return PROTOCOL_TEXT; };
}; };
class Protocol_binary :public Protocol class Protocol_binary final :public Protocol
{ {
private: private:
uint bit_fields; uint bit_fields;
...@@ -279,7 +280,7 @@ class Protocol_binary :public Protocol ...@@ -279,7 +280,7 @@ class Protocol_binary :public Protocol
virtual bool send_out_parameters(List<Item_param> *sp_params); virtual bool send_out_parameters(List<Item_param> *sp_params);
virtual enum enum_protocol_type type() { return PROTOCOL_BINARY; }; enum enum_protocol_type type() override { return PROTOCOL_BINARY; };
}; };
...@@ -297,37 +298,38 @@ class Protocol_binary :public Protocol ...@@ -297,37 +298,38 @@ class Protocol_binary :public Protocol
select_send::send_data() & co., and also uses Protocol_discard object. select_send::send_data() & co., and also uses Protocol_discard object.
*/ */
class Protocol_discard : public Protocol_text class Protocol_discard final : public Protocol
{ {
public: public:
Protocol_discard(THD *thd_arg) : Protocol_text(thd_arg) {} Protocol_discard(THD *thd_arg) : Protocol(thd_arg) {}
bool write() { return 0; } bool write() override { return 0; }
bool send_result_set_metadata(List<Item> *, uint) { return 0; } bool send_result_set_metadata(List<Item> *, uint) override { return 0; }
bool send_eof(uint, uint) { return 0; } bool send_eof(uint, uint) override { return 0; }
void prepare_for_resend() { IF_DBUG(field_pos= 0,); } void prepare_for_resend() override { IF_DBUG(field_pos= 0,); }
bool send_out_parameters(List<Item_param> *sp_params) override { return false; }
/* /*
Provide dummy overrides for any storage methods so that we Provide dummy overrides for any storage methods so that we
avoid allocating and copying of data avoid allocating and copying of data
*/ */
bool store_null() { return false; } bool store_null() override { return false; }
bool store_tiny(longlong) { return false; } bool store_tiny(longlong) override { return false; }
bool store_short(longlong) { return false; } bool store_short(longlong) override { return false; }
bool store_long(longlong) { return false; } bool store_long(longlong) override { return false; }
bool store_longlong(longlong, bool) { return false; } bool store_longlong(longlong, bool) override { return false; }
bool store_decimal(const my_decimal *) { return false; } bool store_decimal(const my_decimal *) override { return false; }
bool store_str(const char *, size_t, CHARSET_INFO *, my_repertoire_t, bool store_str(const char *, size_t, CHARSET_INFO *, my_repertoire_t,
CHARSET_INFO *) CHARSET_INFO *) override
{ {
return false; return false;
} }
bool store(MYSQL_TIME *, int) { return false; } bool store(MYSQL_TIME *, int) override { return false; }
bool store_date(MYSQL_TIME *) { return false; } bool store_date(MYSQL_TIME *) override { return false; }
bool store_time(MYSQL_TIME *, int) { return false; } bool store_time(MYSQL_TIME *, int) override { return false; }
bool store(float, uint32, String *) { return false; } bool store(float, uint32, String *) override { return false; }
bool store(double, uint32, String *) { return false; } bool store(double, uint32, String *) override { return false; }
bool store(Field *) { return false; } bool store(Field *) override { return false; }
enum enum_protocol_type type() override { return PROTOCOL_DISCARD; };
}; };
......
...@@ -73,7 +73,7 @@ class Archive_share : public Handler_share ...@@ -73,7 +73,7 @@ class Archive_share : public Handler_share
*/ */
#define ARCHIVE_VERSION 3 #define ARCHIVE_VERSION 3
class ha_archive: public handler class ha_archive final : public handler
{ {
THR_LOCK_DATA lock; /* MySQL lock */ THR_LOCK_DATA lock; /* MySQL lock */
Archive_share *share; /* Shared lock info */ Archive_share *share; /* Shared lock info */
......
...@@ -36,7 +36,7 @@ struct st_blackhole_share { ...@@ -36,7 +36,7 @@ struct st_blackhole_share {
Class definition for the blackhole storage engine Class definition for the blackhole storage engine
"Dumbest named feature ever" "Dumbest named feature ever"
*/ */
class ha_blackhole: public handler class ha_blackhole final : public handler
{ {
THR_LOCK_DATA lock; /* MySQL lock */ THR_LOCK_DATA lock; /* MySQL lock */
st_blackhole_share *share; st_blackhole_share *share;
......
...@@ -144,7 +144,7 @@ typedef class ha_connect *PHC; ...@@ -144,7 +144,7 @@ typedef class ha_connect *PHC;
/** @brief /** @brief
Class definition for the storage engine Class definition for the storage engine
*/ */
class ha_connect: public handler class ha_connect final : public handler
{ {
THR_LOCK_DATA lock; ///< MySQL lock THR_LOCK_DATA lock; ///< MySQL lock
CONNECT_SHARE *share; ///< Shared lock info CONNECT_SHARE *share; ///< Shared lock info
......
...@@ -57,7 +57,7 @@ struct tina_set { ...@@ -57,7 +57,7 @@ struct tina_set {
my_off_t end; my_off_t end;
}; };
class ha_tina: public handler class ha_tina final : public handler
{ {
THR_LOCK_DATA lock; /* MySQL lock */ THR_LOCK_DATA lock; /* MySQL lock */
TINA_SHARE *share; /* Shared lock info */ TINA_SHARE *share; /* Shared lock info */
......
...@@ -260,7 +260,7 @@ class federatedx_txn ...@@ -260,7 +260,7 @@ class federatedx_txn
/* /*
Class definition for the storage engine Class definition for the storage engine
*/ */
class ha_federatedx: public handler class ha_federatedx final : public handler
{ {
friend int federatedx_db_init(void *p); friend int federatedx_db_init(void *p);
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include <heap.h> #include <heap.h>
#include "sql_class.h" /* THD */ #include "sql_class.h" /* THD */
class ha_heap: public handler class ha_heap final : public handler
{ {
HP_INFO *file; HP_INFO *file;
HP_SHARE *internal_share; HP_SHARE *internal_share;
......
...@@ -58,7 +58,7 @@ struct st_handler_tablename ...@@ -58,7 +58,7 @@ struct st_handler_tablename
const char *tablename; const char *tablename;
}; };
/** The class defining a handle to an Innodb table */ /** The class defining a handle to an Innodb table */
class ha_innobase final: public handler class ha_innobase final : public handler
{ {
public: public:
ha_innobase(handlerton* hton, TABLE_SHARE* table_arg); ha_innobase(handlerton* hton, TABLE_SHARE* table_arg);
......
...@@ -39,6 +39,11 @@ C_MODE_END ...@@ -39,6 +39,11 @@ C_MODE_END
extern TYPELIB maria_recover_typelib; extern TYPELIB maria_recover_typelib;
extern ulonglong maria_recover_options; extern ulonglong maria_recover_options;
/*
In the ha_maria class there are a few virtual methods that are not marked as
'final'. This is because they are re-defined by the ha_s3 engine.
*/
class __attribute__((visibility("default"))) ha_maria :public handler class __attribute__((visibility("default"))) ha_maria :public handler
{ {
public: public:
...@@ -61,98 +66,98 @@ class __attribute__((visibility("default"))) ha_maria :public handler ...@@ -61,98 +66,98 @@ class __attribute__((visibility("default"))) ha_maria :public handler
ha_maria(handlerton *hton, TABLE_SHARE * table_arg); ha_maria(handlerton *hton, TABLE_SHARE * table_arg);
~ha_maria() {} ~ha_maria() {}
handler *clone(const char *name, MEM_ROOT *mem_root); handler *clone(const char *name, MEM_ROOT *mem_root);
const char *index_type(uint key_number); const char *index_type(uint key_number) override final;
ulonglong table_flags() const ulonglong table_flags() const override final
{ return int_table_flags; } { return int_table_flags; }
ulong index_flags(uint inx, uint part, bool all_parts) const; ulong index_flags(uint inx, uint part, bool all_parts) const override final;
uint max_supported_keys() const uint max_supported_keys() const override final
{ return MARIA_MAX_KEY; } { return MARIA_MAX_KEY; }
uint max_supported_key_length() const; uint max_supported_key_length() const override final;
uint max_supported_key_part_length() const uint max_supported_key_part_length() const override final
{ return max_supported_key_length(); } { return max_supported_key_length(); }
enum row_type get_row_type() const; enum row_type get_row_type() const override final;
void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share); void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) override final;
virtual double scan_time(); virtual double scan_time() override final;
int open(const char *name, int mode, uint test_if_locked); int open(const char *name, int mode, uint test_if_locked) override;
int close(void); int close(void) override final;
int write_row(const uchar * buf); int write_row(const uchar * buf) override;
int update_row(const uchar * old_data, const uchar * new_data); int update_row(const uchar * old_data, const uchar * new_data) override;
int delete_row(const uchar * buf); int delete_row(const uchar * buf) override;
int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map, int index_read_map(uchar * buf, const uchar * key, key_part_map keypart_map,
enum ha_rkey_function find_flag); enum ha_rkey_function find_flag) override final;
int index_read_idx_map(uchar * buf, uint idx, const uchar * key, int index_read_idx_map(uchar * buf, uint idx, const uchar * key,
key_part_map keypart_map, key_part_map keypart_map,
enum ha_rkey_function find_flag); enum ha_rkey_function find_flag) override final;
int index_read_last_map(uchar * buf, const uchar * key, int index_read_last_map(uchar * buf, const uchar * key,
key_part_map keypart_map); key_part_map keypart_map) override final;
int index_next(uchar * buf); int index_next(uchar * buf) override final;
int index_prev(uchar * buf); int index_prev(uchar * buf) override final;
int index_first(uchar * buf); int index_first(uchar * buf) override final;
int index_last(uchar * buf); int index_last(uchar * buf) override final;
int index_next_same(uchar * buf, const uchar * key, uint keylen); int index_next_same(uchar * buf, const uchar * key, uint keylen) override final;
int ft_init() int ft_init() override final
{ {
if (!ft_handler) if (!ft_handler)
return 1; return 1;
ft_handler->please->reinit_search(ft_handler); ft_handler->please->reinit_search(ft_handler);
return 0; return 0;
} }
FT_INFO *ft_init_ext(uint flags, uint inx, String * key); FT_INFO *ft_init_ext(uint flags, uint inx, String * key) override final;
int ft_read(uchar * buf); int ft_read(uchar * buf) override final;
int index_init(uint idx, bool sorted); int index_init(uint idx, bool sorted) override final;
int index_end(); int index_end() override final;
int rnd_init(bool scan); int rnd_init(bool scan) override final;
int rnd_end(void); int rnd_end(void) override final;
int rnd_next(uchar * buf); int rnd_next(uchar * buf) override final;
int rnd_pos(uchar * buf, uchar * pos); int rnd_pos(uchar * buf, uchar * pos) override final;
int remember_rnd_pos(); int remember_rnd_pos() override final;
int restart_rnd_next(uchar * buf); int restart_rnd_next(uchar * buf) override final;
void position(const uchar * record); void position(const uchar * record) override final;
int info(uint); int info(uint) override final;
int info(uint, my_bool); int info(uint, my_bool);
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation) override final;
int extra_opt(enum ha_extra_function operation, ulong cache_size); int extra_opt(enum ha_extra_function operation, ulong cache_size) override final;
int reset(void); int reset(void) override final;
int external_lock(THD * thd, int lock_type); int external_lock(THD * thd, int lock_type) override;
int start_stmt(THD *thd, thr_lock_type lock_type); int start_stmt(THD *thd, thr_lock_type lock_type) override final;
int delete_all_rows(void); int delete_all_rows(void) override final;
int disable_indexes(uint mode); int disable_indexes(uint mode) override final;
int enable_indexes(uint mode); int enable_indexes(uint mode) override final;
int indexes_are_disabled(void); int indexes_are_disabled(void) override final;
void start_bulk_insert(ha_rows rows, uint flags); void start_bulk_insert(ha_rows rows, uint flags) override final;
int end_bulk_insert(); int end_bulk_insert() override final;
ha_rows records_in_range(uint inx, const key_range *min_key, ha_rows records_in_range(uint inx, const key_range *min_key,
const key_range *max_key, const key_range *max_key,
page_range *pages); page_range *pages) override final;
void update_create_info(HA_CREATE_INFO * create_info); void update_create_info(HA_CREATE_INFO * create_info) override final;
int create(const char *name, TABLE * form, HA_CREATE_INFO * create_info); int create(const char *name, TABLE * form, HA_CREATE_INFO * create_info) override;
THR_LOCK_DATA **store_lock(THD * thd, THR_LOCK_DATA ** to, THR_LOCK_DATA **store_lock(THD * thd, THR_LOCK_DATA ** to,
enum thr_lock_type lock_type); enum thr_lock_type lock_type) override final;
virtual void get_auto_increment(ulonglong offset, ulonglong increment, virtual void get_auto_increment(ulonglong offset, ulonglong increment,
ulonglong nb_desired_values, ulonglong nb_desired_values,
ulonglong *first_value, ulonglong *first_value,
ulonglong *nb_reserved_values); ulonglong *nb_reserved_values) override final;
int rename_table(const char *from, const char *to); int rename_table(const char *from, const char *to) override;
int delete_table(const char *name); int delete_table(const char *name) override;
void drop_table(const char *name); void drop_table(const char *name) override;
int check(THD * thd, HA_CHECK_OPT * check_opt); int check(THD * thd, HA_CHECK_OPT * check_opt) override;
int analyze(THD * thd, HA_CHECK_OPT * check_opt); int analyze(THD * thd, HA_CHECK_OPT * check_opt) override;
int repair(THD * thd, HA_CHECK_OPT * check_opt); int repair(THD * thd, HA_CHECK_OPT * check_opt) override;
bool check_and_repair(THD * thd); bool check_and_repair(THD * thd) override final;
bool is_crashed() const; bool is_crashed() const override final;
bool is_changed() const; bool is_changed() const;
bool auto_repair(int error) const; bool auto_repair(int error) const override final;
int optimize(THD * thd, HA_CHECK_OPT * check_opt); int optimize(THD * thd, HA_CHECK_OPT * check_opt) override final;
int assign_to_keycache(THD * thd, HA_CHECK_OPT * check_opt); int assign_to_keycache(THD * thd, HA_CHECK_OPT * check_opt) override final;
int preload_keys(THD * thd, HA_CHECK_OPT * check_opt); int preload_keys(THD * thd, HA_CHECK_OPT * check_opt) override;
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes); bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes) override final;
#ifdef HAVE_QUERY_CACHE #ifdef HAVE_QUERY_CACHE
my_bool register_query_cache_table(THD *thd, const char *table_key, my_bool register_query_cache_table(THD *thd, const char *table_key,
uint key_length, uint key_length,
qc_engine_callback qc_engine_callback
*engine_callback, *engine_callback,
ulonglong *engine_data); ulonglong *engine_data) override final;
#endif #endif
MARIA_HA *file_ptr(void) MARIA_HA *file_ptr(void)
{ {
...@@ -164,21 +169,21 @@ class __attribute__((visibility("default"))) ha_maria :public handler ...@@ -164,21 +169,21 @@ class __attribute__((visibility("default"))) ha_maria :public handler
* Multi Range Read interface * Multi Range Read interface
*/ */
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf); uint n_ranges, uint mode, HANDLER_BUFFER *buf) override final;
int multi_range_read_next(range_id_t *range_info); int multi_range_read_next(range_id_t *range_info) override final;
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq,
void *seq_init_param, void *seq_init_param,
uint n_ranges, uint *bufsz, uint n_ranges, uint *bufsz,
uint *flags, Cost_estimate *cost); uint *flags, Cost_estimate *cost) override final;
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys,
uint key_parts, uint *bufsz, uint key_parts, uint *bufsz,
uint *flags, Cost_estimate *cost); uint *flags, Cost_estimate *cost) override final;
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size); int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size) override final;
/* Index condition pushdown implementation */ /* Index condition pushdown implementation */
Item *idx_cond_push(uint keyno, Item* idx_cond); Item *idx_cond_push(uint keyno, Item* idx_cond) override final;
int find_unique_row(uchar *record, uint unique_idx); int find_unique_row(uchar *record, uint unique_idx) override final;
/* Following functions are needed by the S3 handler */ /* Following functions are needed by the S3 handler */
virtual S3_INFO *s3_open_args() { return 0; } virtual S3_INFO *s3_open_args() { return 0; }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include "ha_maria.h" #include "ha_maria.h"
class ha_s3 :public ha_maria class ha_s3 final :public ha_maria
{ {
enum alter_table_op enum alter_table_op
{ S3_NO_ALTER, S3_ALTER_TABLE, S3_ADD_PARTITION, S3_ADD_TMP_PARTITION }; { S3_NO_ALTER, S3_ALTER_TABLE, S3_ADD_PARTITION, S3_ADD_TMP_PARTITION };
...@@ -31,52 +31,52 @@ class ha_s3 :public ha_maria ...@@ -31,52 +31,52 @@ class ha_s3 :public ha_maria
~ha_s3() {} ~ha_s3() {}
int create(const char *name, TABLE *table_arg, int create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *ha_create_info) final; HA_CREATE_INFO *ha_create_info);
int open(const char *name, int mode, uint open_flags) final; int open(const char *name, int mode, uint open_flags);
int write_row(const uchar *buf) final; int write_row(const uchar *buf);
int update_row(const uchar * old_data, const uchar * new_data) final int update_row(const uchar * old_data, const uchar * new_data)
{ {
DBUG_ENTER("update_row"); DBUG_ENTER("update_row");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
int delete_row(const uchar * buf) final int delete_row(const uchar * buf)
{ {
DBUG_ENTER("delete_row"); DBUG_ENTER("delete_row");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
int check(THD * thd, HA_CHECK_OPT * check_opt) final int check(THD * thd, HA_CHECK_OPT * check_opt)
{ {
DBUG_ENTER("delete_row"); DBUG_ENTER("delete_row");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
int analyze(THD * thd, HA_CHECK_OPT * check_opt) final int analyze(THD * thd, HA_CHECK_OPT * check_opt)
{ {
DBUG_ENTER("analyze"); DBUG_ENTER("analyze");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
int repair(THD * thd, HA_CHECK_OPT * check_opt) final int repair(THD * thd, HA_CHECK_OPT * check_opt)
{ {
DBUG_ENTER("repair"); DBUG_ENTER("repair");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
int preload_keys(THD * thd, HA_CHECK_OPT * check_opt) final int preload_keys(THD * thd, HA_CHECK_OPT * check_opt)
{ {
DBUG_ENTER("preload_keys"); DBUG_ENTER("preload_keys");
DBUG_RETURN(HA_ERR_WRONG_COMMAND); DBUG_RETURN(HA_ERR_WRONG_COMMAND);
} }
int external_lock(THD * thd, int lock_type) final; int external_lock(THD * thd, int lock_type);
/* /*
drop_table() is only used for internal temporary tables, drop_table() is only used for internal temporary tables,
not applicable for s3 not applicable for s3
*/ */
void drop_table(const char *name) final void drop_table(const char *name)
{ {
} }
int delete_table(const char *name) final; int delete_table(const char *name);
int rename_table(const char *from, const char *to) final; int rename_table(const char *from, const char *to);
int discover_check_version() override; int discover_check_version() override;
int rebind(); int rebind();
S3_INFO *s3_open_args() final { return open_args; } S3_INFO *s3_open_args() { return open_args; }
void register_handler(MARIA_HA *file) final; void register_handler(MARIA_HA *file);
}; };
#endif /* HA_S3_INCLUDED */ #endif /* HA_S3_INCLUDED */
...@@ -41,7 +41,7 @@ C_MODE_START ...@@ -41,7 +41,7 @@ C_MODE_START
check_result_t index_cond_func_myisam(void *arg); check_result_t index_cond_func_myisam(void *arg);
C_MODE_END C_MODE_END
class ha_myisam: public handler class ha_myisam final : public handler
{ {
MI_INFO *file; MI_INFO *file;
ulonglong int_table_flags; ulonglong int_table_flags;
......
...@@ -68,7 +68,7 @@ class Mrg_child_def: public Sql_alloc ...@@ -68,7 +68,7 @@ class Mrg_child_def: public Sql_alloc
}; };
class ha_myisammrg: public handler class ha_myisammrg final : public handler
{ {
MYRG_INFO *file; MYRG_INFO *file;
my_bool is_cloned; /* This instance has been cloned */ my_bool is_cloned; /* This instance has been cloned */
......
...@@ -41,7 +41,7 @@ class PFS_engine_table; ...@@ -41,7 +41,7 @@ class PFS_engine_table;
extern const char *pfs_engine_name; extern const char *pfs_engine_name;
/** A handler for a PERFORMANCE_SCHEMA table. */ /** A handler for a PERFORMANCE_SCHEMA table. */
class ha_perfschema : public handler class ha_perfschema final : public handler
{ {
public: public:
/** /**
......
...@@ -53,7 +53,7 @@ class Sequence_share : public Handler_share { ...@@ -53,7 +53,7 @@ class Sequence_share : public Handler_share {
} }
}; };
class ha_seq: public handler class ha_seq final : public handler
{ {
private: private:
THR_LOCK_DATA lock; THR_LOCK_DATA lock;
......
...@@ -30,7 +30,7 @@ struct CSphSEStats; ...@@ -30,7 +30,7 @@ struct CSphSEStats;
struct CSphSEThreadTable; struct CSphSEThreadTable;
/// Sphinx SE handler class /// Sphinx SE handler class
class ha_sphinx : public handler class ha_sphinx final : public handler
{ {
protected: protected:
THR_LOCK_DATA m_tLock; ///< MySQL lock THR_LOCK_DATA m_tLock; ///< MySQL lock
......
...@@ -49,7 +49,7 @@ struct st_spider_ft_info ...@@ -49,7 +49,7 @@ struct st_spider_ft_info
String *key; String *key;
}; };
class ha_spider: public handler class ha_spider final : public handler
{ {
public: public:
SPIDER_SHARE *share; SPIDER_SHARE *share;
......
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