76 const char *
table_type()
const override {
return "EXAMPLE"; }
114 ulong
index_flags(uint inx [[maybe_unused]], uint part [[maybe_unused]],
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;
186 int open(
const char *
name,
int mode, uint test_if_locked,
192 int close(
void)
override;
256 int info(uint)
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:115
Base class to be used by handlers different shares.
Definition: handler.h:4115
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
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:438
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:346
int close(void) override
We implement this in ha_example.cc; it's a required method.
Definition: ha_example.cc:252
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:681
int write_row(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:287
int index_next(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:371
int external_lock(THD *thd, int lock_type) override
required
Definition: ha_example.cc:613
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:443
int index_first(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:400
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:145
int update_row(const uchar *old_data, uchar *new_data) override
We implement this in ha_example.cc.
Definition: ha_example.cc:321
THR_LOCK_DATA ** store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type) override
required
Definition: ha_example.cc:655
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:720
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:566
ha_example(handlerton *hton, TABLE_SHARE *table_arg)
Definition: ha_example.cc:167
void position(const uchar *record) override
required
Definition: ha_example.cc:491
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:383
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info, dd::Table *table_def) override
required
Definition: ha_example.cc:750
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:228
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:701
int rnd_next(uchar *buf) override
required
Definition: ha_example.cc:463
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:591
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:358
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:507
int index_last(uchar *buf) override
We implement this in ha_example.cc.
Definition: ha_example.cc:417
int info(uint) override
required
Definition: ha_example.cc:552
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4573
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:98
@ HA_KEY_ALG_HASH
Definition: my_base.h:110
ha_rkey_function
Definition: my_base.h:78
ulong key_part_map
Definition: my_base.h:1008
my_off_t ha_rows
Definition: my_base.h:1141
ha_extra_function
Definition: my_base.h:185
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:195
Definition: buf0block_hint.cc:30
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
mode
Definition: file_handle.h:61
required string key
Definition: replication_asynchronous_connection_failover.proto:60
#define HA_MAX_REC_LENGTH
Definition: handler.h:625
#define HA_BINLOG_STMT_CAPABLE
Definition: handler.h:348
case opt name
Definition: sslopt-case.h:29
Struct to hold information about the table that should be created.
Definition: handler.h:3202
This structure is shared between different table objects.
Definition: table.h:701
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:2734
Definition: my_base.h:1125
Definition: mysqlslap.cc:240
thr_lock_type
Definition: thr_lock.h:51
void thr_lock_delete(THR_LOCK *lock)
Definition: thr_lock.cc:323