76 const char *
table_type()
const override {
return "EXAMPLE"; }
115 bool all_parts [[maybe_unused]])
const override {
167 return (
double)(
stats.records +
stats.deleted) / 20.0 + 10;
174 return (
double)rows / 20.0 + 1;
192 int close(
void)
override;
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
Example_share is a class that will be shared among all open handlers.
Definition: ha_example.h:54
~Example_share() override
Definition: ha_example.h:58
THR_LOCK lock
Definition: ha_example.h:56
Example_share()
Definition: ha_example.cc:114
Base class to be used by handlers different shares.
Definition: handler.h:3956
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
Class definition for the storage engine.
Definition: ha_example.h:64
enum ha_key_alg get_default_index_algorithm() const override
Replace key algorithm with one supported by SE, return the default key algorithm for SE if explicit k...
Definition: ha_example.h:84
double scan_time() override
Called in test_quick_select to determine if indexes should be used.
Definition: ha_example.h:166
int rnd_init(bool scan) override
Unlike index_init(), rnd_init() can be called two consecutive times without rnd_end() in between (it ...
Definition: ha_example.cc:437
const char * table_type() const override
The name that will be used for display purposes.
Definition: ha_example.h:76
int delete_row(const uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:345
int close(void) override
We implement this in ha_example.cc; it's a required method.
Definition: ha_example.cc:251
Example_share * share
Shared lock info.
Definition: ha_example.h:66
bool is_index_algorithm_supported(enum ha_key_alg key_alg) const override
Check if SE supports specific key algorithm.
Definition: ha_example.h:87
int delete_table(const char *from, const dd::Table *table_def) override
Used to delete a table.
Definition: ha_example.cc:680
int write_row(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:286
int index_next(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:370
int external_lock(THD *thd, int lock_type) override
required
Definition: ha_example.cc:612
uint max_supported_record_length() const override
unireg.cc will call max_supported_record_length(), max_supported_keys(), max_supported_key_parts(),...
Definition: ha_example.h:126
~ha_example() override=default
int rnd_end() override
Definition: ha_example.cc:442
int index_first(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:399
double read_time(uint, uint, ha_rows rows) override
This method will never be called if you do not implement indexes.
Definition: ha_example.h:173
ulonglong table_flags() const override
This is a list of flags that indicate what functionality the storage engine implements.
Definition: ha_example.h:95
Example_share * get_share()
Get the share.
Definition: ha_example.cc:144
int update_row(const uchar *old_data, uchar *new_data) override
We implement this in ha_example.cc.
Definition: ha_example.cc:320
THR_LOCK_DATA ** store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) override
required
Definition: ha_example.cc:654
ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) override
Given a starting key and an ending key, estimate the number of rows that will exist between the two k...
Definition: ha_example.cc:719
int extra(enum ha_extra_function operation) override
extra() is called whenever the server wishes to send a hint to the storage engine.
Definition: ha_example.cc:565
ha_example(handlerton *hton, TABLE_SHARE *table_arg)
Definition: ha_example.cc:166
void position(const uchar *record) override
required
Definition: ha_example.cc:490
uint max_supported_key_length() const override
unireg.cc will call this to make sure that the storage engine can handle the data it is about to send...
Definition: ha_example.h:161
int index_prev(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:382
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info, dd::Table *table_def) override
required
Definition: ha_example.cc:749
uint max_supported_key_parts() const override
unireg.cc will call this to make sure that the storage engine can handle the data it is about to send...
Definition: ha_example.h:150
int open(const char *name, int mode, uint test_if_locked, const dd::Table *table_def) override
We implement this in ha_example.cc; it's a required method.
Definition: ha_example.cc:227
THR_LOCK_DATA lock
MySQL lock.
Definition: ha_example.h:65
int rename_table(const char *from, const char *to, const dd::Table *from_table_def, dd::Table *to_table_def) override
Renames a table from one name to another via an alter table call.
Definition: ha_example.cc:700
int rnd_next(uchar *buf) override
required
Definition: ha_example.cc:462
uint max_supported_keys() const override
unireg.cc will call this to make sure that the storage engine can handle the data it is about to send...
Definition: ha_example.h:139
int delete_all_rows(void) override
Used to delete all rows in a table, including cases of truncate and cases where the optimizer realize...
Definition: ha_example.cc:590
int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag) override
We implement this in ha_example.cc.
Definition: ha_example.cc:357
ulong index_flags(uint inx, uint part, bool all_parts) const override
This is a bitmap of flags that indicates how the storage engine implements indexes.
Definition: ha_example.h:114
int rnd_pos(uchar *buf, uchar *pos) override
required
Definition: ha_example.cc:506
int index_last(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:416
int info(uint) override
required
Definition: ha_example.cc:551
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4414
A table definition from the master.
Definition: rpl_utility.h:248
This file includes constants used by all storage engines.
ha_key_alg
Definition: my_base.h:97
@ HA_KEY_ALG_HASH
Definition: my_base.h:109
ha_rkey_function
Definition: my_base.h:78
ulong key_part_map
Definition: my_base.h:1007
my_off_t ha_rows
Definition: my_base.h:1140
ha_extra_function
Definition: my_base.h:184
Header for compiler-dependent features.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
static int record
Definition: mysqltest.cc:188
Definition: buf0block_hint.cc:30
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
mode
Definition: file_handle.h:60
required string key
Definition: replication_asynchronous_connection_failover.proto:60
#define HA_MAX_REC_LENGTH
Definition: handler.h:617
#define HA_BINLOG_STMT_CAPABLE
Definition: handler.h:340
case opt name
Definition: sslopt-case.h:33
Struct to hold information about the table that should be created.
Definition: handler.h:3045
This structure is shared between different table objects.
Definition: table.h:690
Definition: thr_lock.h:124
Definition: thr_lock.h:139
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2622
Definition: my_base.h:1124
Definition: mysqlslap.cc:238
thr_lock_type
Definition: thr_lock.h:51
void thr_lock_delete(THR_LOCK *lock)
Definition: thr_lock.cc:322
unsigned int uint
Definition: uca9-dump.cc:75