Commit c1512b1e authored by Monty's avatar Monty Committed by Sergei Petrunia

Added "override" to ha_heap.h, ha_myisam.h, ha_myisammrg.h and ha_sequence.h

Added override to a few functions in ha_partition.h
parent d645025e
...@@ -246,7 +246,7 @@ class ha_json_table: public handler ...@@ -246,7 +246,7 @@ class ha_json_table: public handler
int open(const char *name, int mode, uint test_if_locked) override int open(const char *name, int mode, uint test_if_locked) override
{ return 0; } { return 0; }
int close(void) override { return 0; } int close(void) override { return 0; }
void update_optimizer_costs(OPTIMIZER_COSTS *costs) void update_optimizer_costs(OPTIMIZER_COSTS *costs) override
{ {
memcpy(costs, &heap_optimizer_costs, sizeof(*costs)); memcpy(costs, &heap_optimizer_costs, sizeof(*costs));
} }
......
...@@ -265,7 +265,7 @@ class Range_rowid_filter: public Rowid_filter ...@@ -265,7 +265,7 @@ class Range_rowid_filter: public Rowid_filter
~Range_rowid_filter(); ~Range_rowid_filter();
bool build() { return fill(); } bool build() override { return fill(); }
bool check(char *elem) override bool check(char *elem) override
{ {
...@@ -374,7 +374,7 @@ class Rowid_filter_sorted_array: public Rowid_filter_container ...@@ -374,7 +374,7 @@ class Rowid_filter_sorted_array: public Rowid_filter_container
uint elements() override { return refpos_container.elements(); } uint elements() override { return refpos_container.elements(); }
void sort (int (*cmp) (void *ctxt, const void *el1, const void *el2), void sort (int (*cmp) (void *ctxt, const void *el1, const void *el2),
void *cmp_arg) void *cmp_arg) override
{ {
return refpos_container.sort(cmp, cmp_arg); return refpos_container.sort(cmp, cmp_arg);
} }
......
...@@ -37,15 +37,15 @@ class ha_heap final : public handler ...@@ -37,15 +37,15 @@ class ha_heap final : public handler
public: public:
ha_heap(handlerton *hton, TABLE_SHARE *table); ha_heap(handlerton *hton, TABLE_SHARE *table);
~ha_heap() {} ~ha_heap() {}
handler *clone(const char *name, MEM_ROOT *mem_root); handler *clone(const char *name, MEM_ROOT *mem_root) override;
const char *index_type(uint inx) const char *index_type(uint inx) override
{ {
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
"BTREE" : "HASH"); "BTREE" : "HASH");
} }
/* Rows also use a fixed-size format */ /* Rows also use a fixed-size format */
enum row_type get_row_type() const { return ROW_TYPE_FIXED; } enum row_type get_row_type() const override { return ROW_TYPE_FIXED; }
ulonglong table_flags() const ulonglong table_flags() const override
{ {
return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY | return (HA_FAST_KEY_READ | HA_NO_BLOBS | HA_NULL_IN_KEY |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
...@@ -53,71 +53,73 @@ class ha_heap final : public handler ...@@ -53,71 +53,73 @@ class ha_heap final : public handler
HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED | HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_CAN_INSERT_DELAYED | HA_NO_TRANSACTIONS |
HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_HASH_KEYS); HA_HAS_RECORDS | HA_STATS_RECORDS_IS_EXACT | HA_CAN_HASH_KEYS);
} }
ulong index_flags(uint inx, uint part, bool all_parts) const ulong index_flags(uint inx, uint part, bool all_parts) const override
{ {
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ?
HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE : HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | HA_READ_RANGE :
HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR); HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR);
} }
const key_map *keys_to_use_for_scanning() { return &btree_keys; } const key_map *keys_to_use_for_scanning() override { return &btree_keys; }
uint max_supported_keys() const { return MAX_KEY; } uint max_supported_keys() const override { return MAX_KEY; }
uint max_supported_key_part_length() const { return MAX_KEY_LENGTH; } uint max_supported_key_part_length() const override { return MAX_KEY_LENGTH; }
IO_AND_CPU_COST scan_time() override; IO_AND_CPU_COST scan_time() override;
IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows, IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows,
ulonglong blocks) override; ulonglong blocks) override;
IO_AND_CPU_COST rnd_pos_time(ha_rows rows) override; IO_AND_CPU_COST rnd_pos_time(ha_rows rows) override;
/* 0 for avg_io_cost ensures that there are no read-block calculations */ /* 0 for avg_io_cost ensures that there are no read-block calculations */
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;
void set_keys_for_scanning(void); int write_row(const uchar * buf) override;
int write_row(const uchar * buf); int update_row(const uchar * old_data, const uchar * new_data) override;
int update_row(const uchar * old_data, const uchar * new_data); int delete_row(const uchar * buf) override;
int delete_row(const uchar * buf); 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) override;
ulonglong *nb_reserved_values);
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;
int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map); int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map)
override;
int index_read_idx_map(uchar * buf, uint index, const uchar * key, int index_read_idx_map(uchar * buf, uint index, 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;
int index_next(uchar * buf); int index_next(uchar * buf) override;
int index_prev(uchar * buf); int index_prev(uchar * buf) override;
int index_first(uchar * buf); int index_first(uchar * buf) override;
int index_last(uchar * buf); int index_last(uchar * buf) override;
int rnd_init(bool scan); int rnd_init(bool scan) override;
int rnd_next(uchar *buf); int rnd_next(uchar *buf) override;
int rnd_pos(uchar * buf, uchar *pos); int rnd_pos(uchar * buf, uchar *pos) override;
void position(const uchar *record); void position(const uchar *record) override;
int can_continue_handler_scan(); int can_continue_handler_scan() override;
int info(uint); int info(uint) override;
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation) override;
int reset(); int reset() override;
int external_lock(THD *thd, int lock_type); int external_lock(THD *thd, int lock_type) override;
int delete_all_rows(void); int delete_all_rows(void) override;
int reset_auto_increment(ulonglong value); int reset_auto_increment(ulonglong value) override;
int disable_indexes(uint mode); int disable_indexes(uint mode) override;
int enable_indexes(uint mode); int enable_indexes(uint mode) override;
int indexes_are_disabled(void); int indexes_are_disabled(void) override;
ha_rows records_in_range(uint inx, const key_range *start_key, ha_rows records_in_range(uint inx, const key_range *start_key,
const key_range *end_key, page_range *pages); const key_range *end_key, page_range *pages) override;
int delete_table(const char *from); int delete_table(const char *from) override;
void drop_table(const char *name); void drop_table(const char *name) override;
int rename_table(const char * from, const char * to); int rename_table(const char * from, const char * to) override;
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;
void update_create_info(HA_CREATE_INFO *create_info); void update_create_info(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;
int cmp_ref(const uchar *ref1, const uchar *ref2) int cmp_ref(const uchar *ref1, const uchar *ref2) override
{ {
return memcmp(ref1, ref2, sizeof(HEAP_PTR)); return memcmp(ref1, ref2, sizeof(HEAP_PTR));
} }
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes)
int find_unique_row(uchar *record, uint unique_idx); override;
int find_unique_row(uchar *record, uint unique_idx) override;
private: private:
void update_key_stats(); void update_key_stats();
void set_keys_for_scanning(void);
}; };
...@@ -54,34 +54,35 @@ class ha_myisam final : public handler ...@@ -54,34 +54,35 @@ class ha_myisam final : public handler
public: public:
ha_myisam(handlerton *hton, TABLE_SHARE *table_arg); ha_myisam(handlerton *hton, TABLE_SHARE *table_arg);
~ha_myisam() {} ~ha_myisam() {}
handler *clone(const char *name, MEM_ROOT *mem_root); handler *clone(const char *name, MEM_ROOT *mem_root) override;
const char *index_type(uint key_number); const char *index_type(uint key_number) override;
ulonglong table_flags() const { return int_table_flags; } ulonglong table_flags() const override { return int_table_flags; }
int index_init(uint idx, bool sorted); int index_init(uint idx, bool sorted) override;
int index_end(); int index_end() override;
int rnd_end(); int rnd_end() override;
ulong index_flags(uint inx, uint part, bool all_parts) const; ulong index_flags(uint inx, uint part, bool all_parts) const override;
uint max_supported_keys() const { return MI_MAX_KEY; } uint max_supported_keys() const override { return MI_MAX_KEY; }
uint max_supported_key_parts() const { return HA_MAX_KEY_SEG; } uint max_supported_key_parts() const override { return HA_MAX_KEY_SEG; }
uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_length() const override { return HA_MAX_KEY_LENGTH; }
uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const override
void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share); { return HA_MAX_KEY_LENGTH; }
int open(const char *name, int mode, uint test_if_locked); void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share) override;
int close(void); int open(const char *name, int mode, uint test_if_locked) override;
int write_row(const uchar * buf); int close(void) override;
int update_row(const uchar * old_data, const uchar * new_data); int write_row(const uchar * buf) override;
int delete_row(const uchar * buf); 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, 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;
int index_read_idx_map(uchar *buf, uint index, const uchar *key, int index_read_idx_map(uchar *buf, uint index, 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;
int index_next(uchar * buf); int index_next(uchar * buf) override;
int index_prev(uchar * buf); int index_prev(uchar * buf) override;
int index_first(uchar * buf); int index_first(uchar * buf) override;
int index_last(uchar * buf); int index_last(uchar * buf) override;
int index_next_same(uchar *buf, const uchar *key, uint keylen); int index_next_same(uchar *buf, const uchar *key, uint keylen) override;
int ft_init() override int ft_init() override
{ {
if (!ft_handler) if (!ft_handler)
...@@ -95,73 +96,70 @@ class ha_myisam final : public handler ...@@ -95,73 +96,70 @@ class ha_myisam final : public handler
(uchar *)key->ptr(), key->length(), key->charset(), (uchar *)key->ptr(), key->length(), key->charset(),
table->record[0]); table->record[0]);
} }
int ft_read(uchar *buf); int ft_read(uchar *buf) override;
int rnd_init(bool scan); int rnd_init(bool scan) override;
int rnd_next(uchar *buf); int rnd_next(uchar *buf) override;
int rnd_pos(uchar * buf, uchar *pos); int rnd_pos(uchar * buf, uchar *pos) override;
int remember_rnd_pos(); int remember_rnd_pos() override;
int restart_rnd_next(uchar *buf); int restart_rnd_next(uchar *buf) override;
void position(const uchar *record); void position(const uchar *record) override;
IO_AND_CPU_COST rnd_pos_time(ha_rows rows) override; IO_AND_CPU_COST rnd_pos_time(ha_rows rows) override;
int info(uint); int info(uint) override;
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation) override;
int extra_opt(enum ha_extra_function operation, ulong cache_size); int extra_opt(enum ha_extra_function operation, ulong cache_size) override;
int reset(void); int reset(void) override;
int external_lock(THD *thd, int lock_type); int external_lock(THD *thd, int lock_type) override;
int delete_all_rows(void); int delete_all_rows(void) override;
int reset_auto_increment(ulonglong value); int reset_auto_increment(ulonglong value) override;
int disable_indexes(uint mode); int disable_indexes(uint mode) override;
int enable_indexes(uint mode); int enable_indexes(uint mode) override;
int indexes_are_disabled(void); int indexes_are_disabled(void) override;
void start_bulk_insert(ha_rows rows, uint flags); void start_bulk_insert(ha_rows rows, uint flags) override;
int end_bulk_insert(); int end_bulk_insert() override;
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, page_range *pages); const key_range *max_key, page_range *pages) override;
void update_create_info(HA_CREATE_INFO *create_info); void update_create_info(HA_CREATE_INFO *create_info) override;
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;
virtual void get_auto_increment(ulonglong offset, ulonglong increment, 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;
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;
int check_for_upgrade(HA_CHECK_OPT *check_opt); int check_for_upgrade(HA_CHECK_OPT *check_opt) 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;
bool is_crashed() const; bool is_crashed() const override;
bool auto_repair(int error) const bool auto_repair(int error) const override
{ {
return (myisam_recover_options != HA_RECOVER_OFF && return (myisam_recover_options != HA_RECOVER_OFF &&
error == HA_ERR_CRASHED_ON_USAGE); error == HA_ERR_CRASHED_ON_USAGE);
} }
int optimize(THD* thd, HA_CHECK_OPT* check_opt); int optimize(THD* thd, HA_CHECK_OPT* check_opt) override;
int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt) override;
int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); int preload_keys(THD* thd, HA_CHECK_OPT* check_opt) override;
enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *new_table, enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *new_table,
Alter_inplace_info *alter_info); Alter_inplace_info *alter_info)
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); override;
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes)
override;
#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;
#endif #endif
MI_INFO *file_ptr(void)
{
return file;
}
public:
/** /**
* 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;
int multi_range_read_next(range_id_t *range_info); int multi_range_read_next(range_id_t *range_info) override;
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,
...@@ -169,14 +167,20 @@ class ha_myisam final : public handler ...@@ -169,14 +167,20 @@ class ha_myisam final : public handler
Cost_estimate *cost) override; Cost_estimate *cost) override;
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;
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;
/* Index condition pushdown implementation */ /* Index condition pushdown implementation */
Item *idx_cond_push(uint keyno, Item* idx_cond) override; Item *idx_cond_push(uint keyno, Item* idx_cond) override;
bool rowid_filter_push(Rowid_filter* rowid_filter) override; bool rowid_filter_push(Rowid_filter* rowid_filter) override;
void rowid_filter_changed() override; void rowid_filter_changed() override;
/* Used by myisammrg */
MI_INFO *file_ptr(void)
{
return file;
}
private: private:
DsMrr_impl ds_mrr; DsMrr_impl ds_mrr;
friend check_result_t index_cond_func_myisam(void *arg); friend check_result_t index_cond_func_myisam(void *arg);
......
...@@ -82,8 +82,8 @@ class ha_myisammrg final : public handler ...@@ -82,8 +82,8 @@ class ha_myisammrg final : public handler
ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg); ha_myisammrg(handlerton *hton, TABLE_SHARE *table_arg);
~ha_myisammrg(); ~ha_myisammrg();
const char *index_type(uint key_number); const char *index_type(uint key_number) override;
ulonglong table_flags() const ulonglong table_flags() const override
{ {
return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS | return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_NO_TRANSACTIONS |
HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE |
...@@ -93,15 +93,16 @@ class ha_myisammrg final : public handler ...@@ -93,15 +93,16 @@ class ha_myisammrg final : public handler
HA_NO_COPY_ON_ALTER | HA_NO_COPY_ON_ALTER |
HA_DUPLICATE_POS | HA_CAN_MULTISTEP_MERGE); HA_DUPLICATE_POS | HA_CAN_MULTISTEP_MERGE);
} }
ulong index_flags(uint inx, uint part, bool all_parts) const ulong index_flags(uint inx, uint part, bool all_parts) const override
{ {
return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ? return ((table_share->key_info[inx].algorithm == HA_KEY_ALG_FULLTEXT) ?
0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | 0 : HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE |
HA_READ_ORDER | HA_KEYREAD_ONLY); HA_READ_ORDER | HA_KEYREAD_ONLY);
} }
uint max_supported_keys() const { return MI_MAX_KEY; } uint max_supported_keys() const override { return MI_MAX_KEY; }
uint max_supported_key_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_length() const override { return HA_MAX_KEY_LENGTH; }
uint max_supported_key_part_length() const { return HA_MAX_KEY_LENGTH; } uint max_supported_key_part_length() const override
{ return HA_MAX_KEY_LENGTH; }
IO_AND_CPU_COST scan_time() override IO_AND_CPU_COST scan_time() override
{ {
IO_AND_CPU_COST cost; IO_AND_CPU_COST cost;
...@@ -113,58 +114,60 @@ class ha_myisammrg final : public handler ...@@ -113,58 +114,60 @@ class ha_myisammrg final : public handler
IO_AND_CPU_COST rnd_pos_time(ha_rows rows) override; IO_AND_CPU_COST rnd_pos_time(ha_rows rows) override;
IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows, IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows,
ulonglong blocks) override; ulonglong blocks) override;
int open(const char *name, int mode, uint test_if_locked); int open(const char *name, int mode, uint test_if_locked) override;
int add_children_list(void); handler *clone(const char *name, MEM_ROOT *mem_root) override;
int attach_children(void); int close(void) override;
int detach_children(void); int write_row(const uchar * buf) override;
virtual handler *clone(const char *name, MEM_ROOT *mem_root); int update_row(const uchar * old_data, const uchar * new_data) override;
int close(void); int delete_row(const uchar * buf) override;
int write_row(const uchar * buf);
int update_row(const uchar * old_data, const uchar * new_data);
int delete_row(const uchar * buf);
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;
int index_read_idx_map(uchar *buf, uint index, const uchar *key, int index_read_idx_map(uchar *buf, uint index, 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;
int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map); int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map) override;
int index_next(uchar * buf); int index_next(uchar * buf) override;
int index_prev(uchar * buf); int index_prev(uchar * buf) override;
int index_first(uchar * buf); int index_first(uchar * buf) override;
int index_last(uchar * buf); int index_last(uchar * buf) override;
int index_next_same(uchar *buf, const uchar *key, uint keylen); int index_next_same(uchar *buf, const uchar *key, uint keylen) override;
int rnd_init(bool scan); int rnd_init(bool scan) override;
int rnd_next(uchar *buf); int rnd_next(uchar *buf) override;
int rnd_pos(uchar * buf, uchar *pos); int rnd_pos(uchar * buf, uchar *pos) override;
void position(const uchar *record); void position(const uchar *record) override;
ha_rows records_in_range(uint inx, const key_range *start_key, ha_rows records_in_range(uint inx, const key_range *start_key,
const key_range *end_key, page_range *pages); const key_range *end_key, page_range *pages) override;
int delete_all_rows(); int delete_all_rows() override;
int info(uint); int info(uint) override;
int reset(void); int reset(void) override;
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation) override;
int extra_opt(enum ha_extra_function operation, ulong cache_size); int extra_opt(enum ha_extra_function operation, ulong cache_size) override;
int external_lock(THD *thd, int lock_type); int external_lock(THD *thd, int lock_type) override;
uint lock_count(void) const; uint lock_count(void) const override;
int create_mrg(const char *name, HA_CREATE_INFO *create_info); int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info) override;
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
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;
void update_create_info(HA_CREATE_INFO *create_info); void update_create_info(HA_CREATE_INFO *create_info) override;
void append_create_info(String *packet); void append_create_info(String *packet) override;
MYRG_INFO *myrg_info() { return file; }
TABLE *table_ptr() { return table; }
enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *, enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *,
Alter_inplace_info *); Alter_inplace_info *) override;
bool inplace_alter_table(TABLE *altered_table, bool inplace_alter_table(TABLE *altered_table,
Alter_inplace_info *ha_alter_info); Alter_inplace_info *ha_alter_info) override;
int check(THD* thd, HA_CHECK_OPT* check_opt); int check(THD* thd, HA_CHECK_OPT* check_opt) override;
ha_rows records(); ha_rows records() override;
virtual uint count_query_cache_dependant_tables(uint8 *tables_type); virtual uint count_query_cache_dependant_tables(uint8 *tables_type) override;
virtual my_bool virtual my_bool
register_query_cache_dependant_tables(THD *thd, register_query_cache_dependant_tables(THD *thd,
Query_cache *cache, Query_cache *cache,
Query_cache_block_table **block, Query_cache_block_table **block,
uint *n); uint *n) override;
virtual void set_lock_type(enum thr_lock_type lock); virtual void set_lock_type(enum thr_lock_type lock) override;
/* Internal interface functions, not part of the normal handler interface */
int add_children_list(void);
int attach_children(void);
int detach_children(void);
int create_mrg(const char *name, HA_CREATE_INFO *create_info);
MYRG_INFO *myrg_info() { return file; }
TABLE *table_ptr() { return table; }
}; };
...@@ -64,52 +64,53 @@ class ha_seq final : public handler ...@@ -64,52 +64,53 @@ class ha_seq final : public handler
Sequence_share *seqs; Sequence_share *seqs;
ha_seq(handlerton *hton, TABLE_SHARE *table_arg) ha_seq(handlerton *hton, TABLE_SHARE *table_arg)
: handler(hton, table_arg), seqs(0) { } : handler(hton, table_arg), seqs(0) { }
ulonglong table_flags() const ulonglong table_flags() const override
{ return HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; } { return HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; }
/* open/close/locking */ /* open/close/locking */
int create(const char *name, TABLE *table_arg, int create(const char *name, TABLE *table_arg,
HA_CREATE_INFO *create_info) HA_CREATE_INFO *create_info) override
{ return HA_ERR_WRONG_COMMAND; } { return HA_ERR_WRONG_COMMAND; }
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;
int delete_table(const char *name) int delete_table(const char *name) override
{ {
return 0; return 0;
} }
THR_LOCK_DATA **store_lock(THD *, THR_LOCK_DATA **, enum thr_lock_type); THR_LOCK_DATA **store_lock(THD *, THR_LOCK_DATA **, enum thr_lock_type)
override;
/* table scan */ /* table scan */
int rnd_init(bool scan); int rnd_init(bool scan) override;
int rnd_next(unsigned char *buf); int rnd_next(unsigned char *buf) override;
void position(const uchar *record); void position(const uchar *record) override;
int rnd_pos(uchar *buf, uchar *pos); int rnd_pos(uchar *buf, uchar *pos) override;
int info(uint flag); int info(uint flag) override;
IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows, IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows,
ulonglong blocks) override ulonglong blocks) override
{ {
/* Avoids assert in total_cost() and makes DBUG_PRINT more consistent */ /* Avoids assert in total_cost() and makes DBUG_PRINT more consistent */
return {0,0}; return {0,0};
} }
IO_AND_CPU_COST scan_time() IO_AND_CPU_COST scan_time() override
{ {
/* Avoids assert in total_cost() and makes DBUG_PRINT more consistent */ /* Avoids assert in total_cost() and makes DBUG_PRINT more consistent */
return {0, 0}; return {0, 0};
} }
/* indexes */ /* indexes */
ulong index_flags(uint inx, uint part, bool all_parts) const ulong index_flags(uint inx, uint part, bool all_parts) const override
{ return HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER | { return HA_READ_NEXT | HA_READ_PREV | HA_READ_ORDER |
HA_READ_RANGE | HA_KEYREAD_ONLY; } HA_READ_RANGE | HA_KEYREAD_ONLY; }
uint max_supported_keys() const { return 1; } uint max_supported_keys() const override { return 1; }
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;
int index_next(uchar *buf); int index_next(uchar *buf) override;
int index_prev(uchar *buf); int index_prev(uchar *buf) override;
int index_first(uchar *buf); int index_first(uchar *buf) override;
int index_last(uchar *buf); int index_last(uchar *buf) override;
ha_rows records_in_range(uint inx, const key_range *start_key, ha_rows records_in_range(uint inx, const key_range *start_key,
const key_range *end_key, page_range *pages); const key_range *end_key, page_range *pages) override;
private: private:
void set(uchar *buf); void set(uchar *buf);
......
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