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 {
};
class Field_decimal :public Field_real {
class Field_decimal final :public Field_real {
public:
Field_decimal(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
......@@ -2320,7 +2320,7 @@ class Field_decimal :public Field_real {
/* 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:
/* The maximum number of decimal digits can be stored */
uint precision;
......@@ -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
{
......@@ -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
{
......@@ -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
{
......@@ -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:
Field_float(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
......@@ -2898,28 +2898,28 @@ class Field_double :public Field_real {
}
const Type_handler *type_handler() const override
{ return &type_handler_double; }
enum ha_base_keytype key_type() const override { return HA_KEYTYPE_DOUBLE; }
int store(const char *to,size_t length,CHARSET_INFO *charset) override;
int store(double nr) override;
int store(longlong nr, bool unsigned_val) override;
int reset() override { bzero(ptr,sizeof(double)); return 0; }
double val_real() override;
longlong val_int() override { return val_int_from_real(false); }
ulonglong val_uint() override { return (ulonglong) val_int_from_real(true); }
String *val_str(String *, String *) override;
bool send_binary(Protocol *protocol) override;
int cmp(const uchar *,const uchar *) const override;
void sort_string(uchar *buff, uint length) override;
uint32 pack_length() const override { return sizeof(double); }
uint row_pack_length() const override { return pack_length(); }
ulonglong get_max_int_value() const override
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 final;
int store(double nr) override final;
int store(longlong nr, bool unsigned_val) override final;
int reset() override final { bzero(ptr,sizeof(double)); return 0; }
double val_real() override final;
longlong val_int() override final { return val_int_from_real(false); }
ulonglong val_uint() override final { return (ulonglong) val_int_from_real(true); }
String *val_str(String *, String *) override final;
bool send_binary(Protocol *protocol) override final;
int cmp(const uchar *,const uchar *) const override final;
void sort_string(uchar *buff, uint length) override final;
uint32 pack_length() const override final { return sizeof(double); }
uint row_pack_length() const override final { return pack_length(); }
ulonglong get_max_int_value() const override final
{
/*
We use the maximum as per IEEE754-2008 standard, 2^53
*/
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 {
{
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; }
int store(double nr) override { null[0]=1; return 0; }
int store(longlong nr, bool unsigned_val) override { null[0]=1; return 0; }
int store_decimal(const my_decimal *d) override { null[0]=1; return 0; }
int reset() override { return 0; }
double val_real() override { return 0.0;}
longlong val_int() override { return 0;}
bool val_bool() override { return false; }
my_decimal *val_decimal(my_decimal *) override { return 0; }
String *val_str(String *value,String *value2) override
int store(double nr) override final { 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 final { null[0]=1; return 0; }
int reset() override final { return 0; }
double val_real() override final { return 0.0;}
longlong val_int() override final { return 0;}
bool val_bool() override final { return false; }
my_decimal *val_decimal(my_decimal *) override final { return 0; }
String *val_str(String *value,String *value2) override final
{ value2->length(0); return value2;}
bool is_equal(const Column_definition &new_field) const override;
int cmp(const uchar *a, const uchar *b) const override { return 0;}
void sort_string(uchar *buff, uint length) override {}
uint32 pack_length() const override { return 0; }
void sql_type(String &str) const override;
uint size_of() const override { return sizeof *this; }
uint32 max_display_length() const override { return 4; }
void move_field_offset(my_ptrdiff_t ptr_diff) override {}
bool is_equal(const Column_definition &new_field) const override final;
int cmp(const uchar *a, const uchar *b) const override final { return 0;}
void sort_string(uchar *buff, uint length) override final {}
uint32 pack_length() const override final { return 0; }
void sql_type(String &str) const override final;
uint size_of() const override final { return sizeof *this; }
uint32 max_display_length() const override final { return 4; }
void move_field_offset(my_ptrdiff_t ptr_diff) override final {}
bool can_optimize_keypart_ref(const Item_bool_func *cond,
const Item *item) const override
const Item *item) const override final
{
return false;
}
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;
}
};
class Field_temporal: public Field {
class Field_temporal :public Field {
protected:
Item *get_equal_const_item_datetime(THD *thd, const Context &ctx,
Item *const_item);
......@@ -3098,7 +3098,7 @@ class Field_temporal: public Field {
- DATETIME(1..6)
- DATETIME(0..6) - MySQL56 version
*/
class Field_temporal_with_date: public Field_temporal {
class Field_temporal_with_date :public Field_temporal {
protected:
virtual void store_TIME(const MYSQL_TIME *ltime) = 0;
void store_datetime(const Datetime &dt)
......@@ -3305,7 +3305,7 @@ class Field_timestamp_hires :public Field_timestamp_with_dec {
/**
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;
public:
Field_timestampf(uchar *ptr_arg,
......@@ -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:
Field_year(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
......@@ -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:
int store_TIME_with_warning(const Datetime *ltime, const ErrConv *str,
......@@ -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;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
......@@ -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;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
......@@ -3571,7 +3571,7 @@ class Field_time :public Field_temporal {
};
class Field_time0: public Field_time
class Field_time0 final :public Field_time
{
protected:
void store_TIME(const MYSQL_TIME *ltime) override;
......@@ -3628,7 +3628,7 @@ class Field_time_with_dec :public Field_time {
/**
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;
void store_TIME(const MYSQL_TIME *) override;
public:
......@@ -3661,7 +3661,7 @@ class Field_time_hires :public Field_time_with_dec {
/**
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;
public:
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 {
};
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;
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 {
{
DBUG_ASSERT(dec <= TIME_SECOND_PART_DIGITS);
}
uint decimals() const override { return dec; }
enum ha_base_keytype key_type() const override { return HA_KEYTYPE_BINARY; }
void make_send_field(Send_field *field) override;
bool send_binary(Protocol *protocol) override;
uchar *pack(uchar *to, const uchar *from, uint max_length) override
uint decimals() const override final { return dec; }
enum ha_base_keytype key_type() const override final { return HA_KEYTYPE_BINARY; }
void make_send_field(Send_field *field) override final;
bool send_binary(Protocol *protocol) override final;
uchar *pack(uchar *to, const uchar *from, uint max_length) override final
{ return Field::pack(to, from, max_length); }
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); }
void sort_string(uchar *to, uint length) override
void sort_string(uchar *to, uint length) override final
{
DBUG_ASSERT(length == pack_length());
memcpy(to, ptr, length);
}
double val_real() override;
longlong val_int() override;
String *val_str(String *, String *) override;
double val_real() override final;
longlong val_int() override final;
String *val_str(String *, String *) override final;
};
/**
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;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
const override;
......@@ -3861,7 +3865,8 @@ class Field_datetime_hires :public Field_datetime_with_dec {
/**
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;
bool get_TIME(MYSQL_TIME *ltime, const uchar *pos, date_mode_t fuzzydate)
const override;
......@@ -3955,7 +3960,7 @@ new_Field_datetime(MEM_ROOT *root, uchar *ptr, uchar *null_ptr, uchar null_bit,
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
{
public:
......@@ -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:
Field_varstring_compressed(uchar *ptr_arg,
uint32 len_arg, uint length_bytes_arg,
......@@ -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:
Field_blob_compressed(uchar *ptr_arg, uchar *null_ptr_arg,
uchar null_bit_arg, enum utype unireg_check_arg,
......@@ -4756,7 +4761,7 @@ class Field_enum :public Field_str {
};
class Field_set :public Field_enum {
class Field_set final :public Field_enum {
public:
Field_set(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
......@@ -5005,7 +5010,7 @@ class Field_bit :public Field {
an extended version of Field_bit_as_char and not the other way
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:
Field_bit_as_char(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg,
......@@ -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;
public:
......
......@@ -2157,7 +2157,7 @@ class Item_aggregate_ref : public Item_ref
const LEX_CSTRING &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)
(*ref)->print(str, query_type);
......
......@@ -744,7 +744,7 @@ class Item_func_eq :public Item_bool_rowready_func2
{ 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:
Item_func_equal(THD *thd, Item *a, Item *b):
......@@ -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:
COND_EQUAL m_cond_equal; /* contains list of Item_equal objects for
......@@ -3368,7 +3368,7 @@ inline bool is_cond_and(Item *item)
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:
Item_cond_or(THD *thd): Item_cond(thd) {}
......
......@@ -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;
bool fix_length_and_dec();
......@@ -1033,13 +1033,13 @@ class Item_sum_variance : public Item_sum_double
enum Sumfunctype sum_func () const { return VARIANCE_FUNC; }
void fix_length_and_dec_double();
void fix_length_and_dec_decimal();
void clear();
bool add();
void clear() override final;
bool add() override final;
double val_real();
void reset_field();
void update_field();
void reset_field() override final;
void update_field() override final;
Item *result_item(THD *thd, Field *field);
void no_rows_in_result() {}
void no_rows_in_result() override final {}
const char *func_name() const
{ return sample ? "var_samp(" : "variance("; }
Item *copy_or_same(THD* thd);
......@@ -1057,7 +1057,7 @@ class Item_sum_variance : public Item_sum_double
standard_deviation(a) = sqrt(variance(a))
*/
class Item_sum_std :public Item_sum_variance
class Item_sum_std final :public Item_sum_variance
{
public:
Item_sum_std(THD *thd, Item *item_par, uint sample_arg):
......@@ -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:
......@@ -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:
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
};
class Item_sum_max :public Item_sum_min_max
class Item_sum_max final :public Item_sum_min_max
{
public:
Item_sum_max(THD *thd, Item *item_par): Item_sum_min_max(thd, item_par, -1) {}
......@@ -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:
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
};
class Item_sum_and :public Item_sum_bit
class Item_sum_and final :public Item_sum_bit
{
public:
Item_sum_and(THD *thd, Item *item_par):
......@@ -1292,7 +1292,7 @@ class Item_sum_and :public Item_sum_bit
void set_bits_from_counters();
};
class Item_sum_xor :public Item_sum_bit
class Item_sum_xor final :public Item_sum_bit
{
public:
Item_sum_xor(THD *thd, Item *item_par): Item_sum_bit(thd, item_par, 0) {}
......@@ -1359,7 +1359,7 @@ struct st_sp_security_context;
Example:
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
{
private:
......
......@@ -190,7 +190,8 @@ class Protocol
Before adding a new type, please make sure
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;
......@@ -204,7 +205,7 @@ class Protocol
/** Class used for the old (MySQL 4.0 protocol). */
class Protocol_text :public Protocol
class Protocol_text final :public Protocol
{
public:
Protocol_text(THD *thd_arg, ulong prealloc= 0)
......@@ -242,11 +243,11 @@ class Protocol_text :public Protocol
bool store_field_metadata_for_list_fields(const THD *thd, Field *field,
const TABLE_LIST *table_list,
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:
uint bit_fields;
......@@ -279,7 +280,7 @@ class Protocol_binary :public Protocol
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
select_send::send_data() & co., and also uses Protocol_discard object.
*/
class Protocol_discard : public Protocol_text
class Protocol_discard final : public Protocol
{
public:
Protocol_discard(THD *thd_arg) : Protocol_text(thd_arg) {}
bool write() { return 0; }
bool send_result_set_metadata(List<Item> *, uint) { return 0; }
bool send_eof(uint, uint) { return 0; }
void prepare_for_resend() { IF_DBUG(field_pos= 0,); }
Protocol_discard(THD *thd_arg) : Protocol(thd_arg) {}
bool write() override { return 0; }
bool send_result_set_metadata(List<Item> *, uint) override { return 0; }
bool send_eof(uint, uint) override { return 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
avoid allocating and copying of data
*/
bool store_null() { return false; }
bool store_tiny(longlong) { return false; }
bool store_short(longlong) { return false; }
bool store_long(longlong) { return false; }
bool store_longlong(longlong, bool) { return false; }
bool store_decimal(const my_decimal *) { return false; }
bool store_null() override { return false; }
bool store_tiny(longlong) override { return false; }
bool store_short(longlong) override { return false; }
bool store_long(longlong) override { return false; }
bool store_longlong(longlong, bool) override { return false; }
bool store_decimal(const my_decimal *) override { return false; }
bool store_str(const char *, size_t, CHARSET_INFO *, my_repertoire_t,
CHARSET_INFO *)
CHARSET_INFO *) override
{
return false;
}
bool store(MYSQL_TIME *, int) { return false; }
bool store_date(MYSQL_TIME *) { return false; }
bool store_time(MYSQL_TIME *, int) { return false; }
bool store(float, uint32, String *) { return false; }
bool store(double, uint32, String *) { return false; }
bool store(Field *) { return false; }
bool store(MYSQL_TIME *, int) override { return false; }
bool store_date(MYSQL_TIME *) override { return false; }
bool store_time(MYSQL_TIME *, int) override { return false; }
bool store(float, uint32, String *) override { return false; }
bool store(double, uint32, String *) override { 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
*/
#define ARCHIVE_VERSION 3
class ha_archive: public handler
class ha_archive final : public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
Archive_share *share; /* Shared lock info */
......
......@@ -36,7 +36,7 @@ struct st_blackhole_share {
Class definition for the blackhole storage engine
"Dumbest named feature ever"
*/
class ha_blackhole: public handler
class ha_blackhole final : public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
st_blackhole_share *share;
......
......@@ -144,7 +144,7 @@ typedef class ha_connect *PHC;
/** @brief
Class definition for the storage engine
*/
class ha_connect: public handler
class ha_connect final : public handler
{
THR_LOCK_DATA lock; ///< MySQL lock
CONNECT_SHARE *share; ///< Shared lock info
......
......@@ -57,7 +57,7 @@ struct tina_set {
my_off_t end;
};
class ha_tina: public handler
class ha_tina final : public handler
{
THR_LOCK_DATA lock; /* MySQL lock */
TINA_SHARE *share; /* Shared lock info */
......
......@@ -260,7 +260,7 @@ class federatedx_txn
/*
Class definition for the storage engine
*/
class ha_federatedx: public handler
class ha_federatedx final : public handler
{
friend int federatedx_db_init(void *p);
......
......@@ -25,7 +25,7 @@
#include <heap.h>
#include "sql_class.h" /* THD */
class ha_heap: public handler
class ha_heap final : public handler
{
HP_INFO *file;
HP_SHARE *internal_share;
......
......@@ -58,7 +58,7 @@ struct st_handler_tablename
const char *tablename;
};
/** The class defining a handle to an Innodb table */
class ha_innobase final: public handler
class ha_innobase final : public handler
{
public:
ha_innobase(handlerton* hton, TABLE_SHARE* table_arg);
......
......@@ -39,6 +39,11 @@ C_MODE_END
extern TYPELIB maria_recover_typelib;
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
{
public:
......@@ -61,98 +66,98 @@ class __attribute__((visibility("default"))) ha_maria :public handler
ha_maria(handlerton *hton, TABLE_SHARE * table_arg);
~ha_maria() {}
handler *clone(const char *name, MEM_ROOT *mem_root);
const char *index_type(uint key_number);
ulonglong table_flags() const
const char *index_type(uint key_number) override final;
ulonglong table_flags() const override final
{ return int_table_flags; }
ulong index_flags(uint inx, uint part, bool all_parts) const;
uint max_supported_keys() const
ulong index_flags(uint inx, uint part, bool all_parts) const override final;
uint max_supported_keys() const override final
{ return MARIA_MAX_KEY; }
uint max_supported_key_length() const;
uint max_supported_key_part_length() const
uint max_supported_key_length() const override final;
uint max_supported_key_part_length() const override final
{ return max_supported_key_length(); }
enum row_type get_row_type() const;
void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share);
virtual double scan_time();
int open(const char *name, int mode, uint test_if_locked);
int close(void);
int write_row(const uchar * buf);
int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
enum row_type get_row_type() const override final;
void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) override final;
virtual double scan_time() override final;
int open(const char *name, int mode, uint test_if_locked) override;
int close(void) override final;
int write_row(const uchar * buf) override;
int update_row(const uchar * old_data, const uchar * new_data) override;
int delete_row(const uchar * buf) override;
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,
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,
key_part_map keypart_map);
int index_next(uchar * buf);
int index_prev(uchar * buf);
int index_first(uchar * buf);
int index_last(uchar * buf);
int index_next_same(uchar * buf, const uchar * key, uint keylen);
int ft_init()
key_part_map keypart_map) override final;
int index_next(uchar * buf) override final;
int index_prev(uchar * buf) override final;
int index_first(uchar * buf) override final;
int index_last(uchar * buf) override final;
int index_next_same(uchar * buf, const uchar * key, uint keylen) override final;
int ft_init() override final
{
if (!ft_handler)
return 1;
ft_handler->please->reinit_search(ft_handler);
return 0;
}
FT_INFO *ft_init_ext(uint flags, uint inx, String * key);
int ft_read(uchar * buf);
int index_init(uint idx, bool sorted);
int index_end();
int rnd_init(bool scan);
int rnd_end(void);
int rnd_next(uchar * buf);
int rnd_pos(uchar * buf, uchar * pos);
int remember_rnd_pos();
int restart_rnd_next(uchar * buf);
void position(const uchar * record);
int info(uint);
FT_INFO *ft_init_ext(uint flags, uint inx, String * key) override final;
int ft_read(uchar * buf) override final;
int index_init(uint idx, bool sorted) override final;
int index_end() override final;
int rnd_init(bool scan) override final;
int rnd_end(void) override final;
int rnd_next(uchar * buf) override final;
int rnd_pos(uchar * buf, uchar * pos) override final;
int remember_rnd_pos() override final;
int restart_rnd_next(uchar * buf) override final;
void position(const uchar * record) override final;
int info(uint) override final;
int info(uint, my_bool);
int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size);
int reset(void);
int external_lock(THD * thd, int lock_type);
int start_stmt(THD *thd, thr_lock_type lock_type);
int delete_all_rows(void);
int disable_indexes(uint mode);
int enable_indexes(uint mode);
int indexes_are_disabled(void);
void start_bulk_insert(ha_rows rows, uint flags);
int end_bulk_insert();
int extra(enum ha_extra_function operation) override final;
int extra_opt(enum ha_extra_function operation, ulong cache_size) override final;
int reset(void) override final;
int external_lock(THD * thd, int lock_type) override;
int start_stmt(THD *thd, thr_lock_type lock_type) override final;
int delete_all_rows(void) override final;
int disable_indexes(uint mode) override final;
int enable_indexes(uint mode) override final;
int indexes_are_disabled(void) override final;
void start_bulk_insert(ha_rows rows, uint flags) override final;
int end_bulk_insert() override final;
ha_rows records_in_range(uint inx, const key_range *min_key,
const key_range *max_key,
page_range *pages);
void update_create_info(HA_CREATE_INFO * create_info);
int create(const char *name, TABLE * form, HA_CREATE_INFO * create_info);
page_range *pages) override final;
void update_create_info(HA_CREATE_INFO * create_info) override final;
int create(const char *name, TABLE * form, HA_CREATE_INFO * create_info) override;
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,
ulonglong nb_desired_values,
ulonglong *first_value,
ulonglong *nb_reserved_values);
int rename_table(const char *from, const char *to);
int delete_table(const char *name);
void drop_table(const char *name);
int check(THD * thd, HA_CHECK_OPT * check_opt);
int analyze(THD * thd, HA_CHECK_OPT * check_opt);
int repair(THD * thd, HA_CHECK_OPT * check_opt);
bool check_and_repair(THD * thd);
bool is_crashed() const;
ulonglong *nb_reserved_values) override final;
int rename_table(const char *from, const char *to) override;
int delete_table(const char *name) override;
void drop_table(const char *name) override;
int check(THD * thd, HA_CHECK_OPT * check_opt) override;
int analyze(THD * thd, HA_CHECK_OPT * check_opt) override;
int repair(THD * thd, HA_CHECK_OPT * check_opt) override;
bool check_and_repair(THD * thd) override final;
bool is_crashed() const override final;
bool is_changed() const;
bool auto_repair(int error) const;
int optimize(THD * thd, HA_CHECK_OPT * check_opt);
int assign_to_keycache(THD * thd, HA_CHECK_OPT * check_opt);
int preload_keys(THD * thd, HA_CHECK_OPT * check_opt);
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes);
bool auto_repair(int error) const override final;
int optimize(THD * thd, HA_CHECK_OPT * check_opt) override final;
int assign_to_keycache(THD * thd, HA_CHECK_OPT * check_opt) override final;
int preload_keys(THD * thd, HA_CHECK_OPT * check_opt) override;
bool check_if_incompatible_data(HA_CREATE_INFO * info, uint table_changes) override final;
#ifdef HAVE_QUERY_CACHE
my_bool register_query_cache_table(THD *thd, const char *table_key,
uint key_length,
qc_engine_callback
*engine_callback,
ulonglong *engine_data);
ulonglong *engine_data) override final;
#endif
MARIA_HA *file_ptr(void)
{
......@@ -164,21 +169,21 @@ class __attribute__((visibility("default"))) ha_maria :public handler
* Multi Range Read interface
*/
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param,
uint n_ranges, uint mode, HANDLER_BUFFER *buf);
int multi_range_read_next(range_id_t *range_info);
uint n_ranges, uint mode, HANDLER_BUFFER *buf) override final;
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,
void *seq_init_param,
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,
uint key_parts, uint *bufsz,
uint *flags, Cost_estimate *cost);
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size);
uint *flags, Cost_estimate *cost) override final;
int multi_range_read_explain_info(uint mrr_mode, char *str, size_t size) override final;
/* 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 */
virtual S3_INFO *s3_open_args() { return 0; }
......
......@@ -19,7 +19,7 @@
#include "ha_maria.h"
class ha_s3 :public ha_maria
class ha_s3 final :public ha_maria
{
enum alter_table_op
{ S3_NO_ALTER, S3_ALTER_TABLE, S3_ADD_PARTITION, S3_ADD_TMP_PARTITION };
......@@ -31,52 +31,52 @@ class ha_s3 :public ha_maria
~ha_s3() {}
int create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *ha_create_info) final;
int open(const char *name, int mode, uint open_flags) final;
int write_row(const uchar *buf) final;
int update_row(const uchar * old_data, const uchar * new_data) final
HA_CREATE_INFO *ha_create_info);
int open(const char *name, int mode, uint open_flags);
int write_row(const uchar *buf);
int update_row(const uchar * old_data, const uchar * new_data)
{
DBUG_ENTER("update_row");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
}
int delete_row(const uchar * buf) final
int delete_row(const uchar * buf)
{
DBUG_ENTER("delete_row");
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_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_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_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_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,
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 rename_table(const char *from, const char *to) final;
int delete_table(const char *name);
int rename_table(const char *from, const char *to);
int discover_check_version() override;
int rebind();
S3_INFO *s3_open_args() final { return open_args; }
void register_handler(MARIA_HA *file) final;
S3_INFO *s3_open_args() { return open_args; }
void register_handler(MARIA_HA *file);
};
#endif /* HA_S3_INCLUDED */
......@@ -41,7 +41,7 @@ C_MODE_START
check_result_t index_cond_func_myisam(void *arg);
C_MODE_END
class ha_myisam: public handler
class ha_myisam final : public handler
{
MI_INFO *file;
ulonglong int_table_flags;
......
......@@ -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;
my_bool is_cloned; /* This instance has been cloned */
......
......@@ -41,7 +41,7 @@ class PFS_engine_table;
extern const char *pfs_engine_name;
/** A handler for a PERFORMANCE_SCHEMA table. */
class ha_perfschema : public handler
class ha_perfschema final : public handler
{
public:
/**
......
......@@ -53,7 +53,7 @@ class Sequence_share : public Handler_share {
}
};
class ha_seq: public handler
class ha_seq final : public handler
{
private:
THR_LOCK_DATA lock;
......
......@@ -30,7 +30,7 @@ struct CSphSEStats;
struct CSphSEThreadTable;
/// Sphinx SE handler class
class ha_sphinx : public handler
class ha_sphinx final : public handler
{
protected:
THR_LOCK_DATA m_tLock; ///< MySQL lock
......
......@@ -49,7 +49,7 @@ struct st_spider_ft_info
String *key;
};
class ha_spider: public handler
class ha_spider final : public handler
{
public:
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