129#ifndef TEMPTABLE_HANDLER_H
130#define TEMPTABLE_HANDLER_H
195 int close()
override;
215 uchar *mysql_row)
override;
249 const uchar *mysql_search_cells,
251 uint mysql_search_cells_len_bytes,
260 uchar *mysql_row)
override;
298 const uchar *mysql_search_cells,
300 uint mysql_search_cells_len_bytes)
override;
306 uchar *mysql_row)
override;
315 const uchar *)
override;
321 uchar *mysql_row)
override;
327 const uchar *mysql_row_old,
329 uchar *mysql_row_new)
override;
336 const uchar *mysql_row)
override;
373 bool)
const override;
482 int reset()
override;
522 const Field &mysql_field)
const;
570 switch (mysql_field.
type()) {
virtual enum_field_types type() const =0
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4583
TABLE_SHARE * table_share
Definition: handler.h:4591
ulonglong Table_flags
Definition: handler.h:4587
TABLE * table
Definition: handler.h:4592
virtual ha_rows estimate_rows_upper_bound()
Return upper bound of current number of records in the table (max.
Definition: handler.h:5582
Memory-block abstraction whose purpose is to serve as a building block for custom memory-allocator im...
Definition: block.h:163
A cursor for iterating over an Index.
Definition: cursor.h:41
Temptable engine handler.
Definition: handler.h:143
int check(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:988
int enable_indexes(uint mode) override
Enable indexes.
Definition: handler.cc:931
~Handler() override=default
Destructor.
int create(const char *table_name, TABLE *mysql_table, HA_CREATE_INFO *, dd::Table *) override
Create an in-memory table.
Definition: handler.cc:109
int open(const char *table_name, int, uint, const dd::Table *) override
Open an existing table.
Definition: handler.cc:195
int index_prev(uchar *mysql_row) override
Step to the previous row in index order.
Definition: handler.cc:589
uint max_supported_key_length() const override
Get the maximum supported index length in bytes.
Definition: handler.cc:848
Block * m_shared_block
Pointer to the non-owned shared-block of memory to be re-used by all Allocator instances or copies ma...
Definition: handler.h:529
int index_first(uchar *) override
Not implemented.
Definition: handler.cc:964
size_t m_index_read_number_of_cells
Number of cells to compare in index_next() after index_read() has positioned m_index_cursor.
Definition: handler.h:557
int analyze(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:976
ulong index_flags(uint index_no, uint, bool) const override
Get the flags for a given index.
Definition: handler.cc:802
int write_row(uchar *mysql_row) override
Insert a new row to the currently opened table.
Definition: handler.cc:657
bool check_if_incompatible_data(HA_CREATE_INFO *, uint) override
Not implemented.
Definition: handler.cc:1046
int index_end() override
End an index scan.
Definition: handler.cc:623
int index_init(uint index_no, bool) override
Set the index to be used by subsequent index_*() calls.
Definition: handler.cc:350
bool primary_key_is_clustered() const override
Not implemented.
Definition: handler.cc:1035
NextCondition
A condition used by index_next_conditional() to control whether to fetch the next row or not.
Definition: handler.h:275
@ NO
No condition - fetch the next row unconditionally.
@ ONLY_IF_SAME
Fetch the next row only if it is the same as the current one.
int rnd_pos(uchar *mysql_row, uchar *position) override
Fetch the record pointed by position.
Definition: handler.cc:314
void update_create_info(HA_CREATE_INFO *) override
Not implemented.
Definition: handler.cc:1012
int rnd_init(bool) override
Begin a table scan.
Definition: handler.cc:245
Storage::Iterator m_rnd_iterator
Iterator used by rnd_init(), rnd_next() and rnd_end() methods.
Definition: handler.h:534
int index_next_same(uchar *mysql_row, const uchar *, uint) override
Advance the index cursor and read the row at that position if its indexed cells are the same as in th...
Definition: handler.cc:493
int rename_table(const char *, const char *, const dd::Table *, dd::Table *) override
Not implemented.
Definition: handler.cc:1017
int index_read_last(uchar *mysql_row, const uchar *mysql_search_cells, uint mysql_search_cells_len_bytes) override
Read the last row that matches mysql_search_cells (in index order).
Definition: handler.cc:576
Table * m_opened_table
Currently opened table, or nullptr if none is opened.
Definition: handler.h:525
void position(const uchar *) override
Store position to current row inside the handler.
Definition: handler.cc:639
int delete_row(const uchar *mysql_row) override
Delete the row where the handler is currently positioned.
Definition: handler.cc:692
handler * clone(const char *, MEM_ROOT *) override
Not implemented.
Definition: handler.cc:958
double scan_time() override
Scan time.
Definition: handler.cc:890
int records(ha_rows *) override
Not implemented.
Definition: handler.cc:1006
int delete_table(const char *table_name, const dd::Table *) override
Delete a table.
Definition: handler.cc:162
int external_lock(THD *, int) override
Not implemented.
Definition: handler.cc:950
int reset() override
Not implemented.
Definition: handler.cc:1000
int disable_indexes(uint mode) override
Disable indexes.
Definition: handler.cc:912
const char * table_type() const override
Get the name of the storage engine.
Definition: handler.cc:777
Result index_next_conditional(uchar *mysql_row, NextCondition condition)
Advance the index cursor and read the row at that position, conditionally.
Definition: handler.cc:506
THR_LOCK_DATA ** store_lock(THD *, THR_LOCK_DATA **, thr_lock_type) override
Not implemented.
Definition: handler.cc:885
int start_stmt(THD *, thr_lock_type) override
Not implemented.
Definition: handler.cc:994
int close() override
Close the opened table.
Definition: handler.cc:225
double read_time(uint, uint, ha_rows rows) override
Read time.
Definition: handler.cc:901
int optimize(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:982
void opened_table_validate()
Definition: handler.h:563
uint max_supported_key_part_length(HA_CREATE_INFO *create_info) const override
Get the maximum supported indexed columns length.
Definition: handler.cc:858
bool is_index_algorithm_supported(ha_key_alg algorithm) const override
Check whether an index algorithm is supported.
Definition: handler.cc:843
longlong get_memory_buffer_size() const override
Get the limit on the memory usage.
Definition: handler.cc:768
void unlock_row() override
Not implemented.
Definition: handler.cc:956
size_t m_deleted_rows
Number of deleted rows by this handler object.
Definition: handler.h:560
Cursor m_index_cursor
Cursor used by index_*() methods.
Definition: handler.h:544
int truncate(dd::Table *) override
Delete all rows in the table.
Definition: handler.cc:720
bool is_field_type_fixed_size(const Field &mysql_field) const
Checks if field has a fixed size.
Definition: handler.h:569
int cmp_ref(const uchar *, const uchar *) const override
Not implemented.
Definition: handler.cc:1040
int index_last(uchar *) override
Not implemented.
Definition: handler.cc:970
bool m_rnd_iterator_is_positioned
Flag that denotes whether m_rnd_iterator is positioned.
Definition: handler.h:539
Table_flags table_flags() const override
Get the table flags.
Definition: handler.cc:782
int index_next(uchar *mysql_row) override
Advance the index cursor and read the row at that position.
Definition: handler.cc:481
int info(uint flag) override
Refresh table stats.
Definition: handler.cc:744
bool get_error_message(int, String *) override
Not implemented.
Definition: handler.cc:1029
int rnd_next(uchar *mysql_row) override
Advance the cursor to the next row in insertion order and retrieve it.
Definition: handler.cc:259
Handler(handlerton *hton, TABLE_SHARE *table_share)
Constructor.
Definition: handler.cc:72
int rnd_end() override
End a table scan.
Definition: handler.cc:336
void init_table_handle_for_HANDLER() override
Not implemented.
Definition: handler.cc:1024
ha_key_alg get_default_index_algorithm() const override
Get the default index algorithm.
Definition: handler.cc:838
int update_row(const uchar *mysql_row_old, uchar *mysql_row_new) override
Update a row.
Definition: handler.cc:669
int index_read(uchar *mysql_row, const uchar *mysql_search_cells, uint mysql_search_cells_len_bytes, ha_rkey_function find_flag) override
Read a row from the currently opened table using the index set with index_init().
Definition: handler.cc:370
int delete_all_rows() override
Delete all rows in the table.
Definition: handler.cc:739
Iterator over a Storage object.
Definition: storage.h:51
const TABLE_SHARE * mysql_table_share() const
Definition: table.h:175
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:71
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:86
@ MYSQL_TYPE_BLOB
Definition: field_types.h:87
@ MYSQL_TYPE_VECTOR
Definition: field_types.h:77
@ MYSQL_TYPE_JSON
Definition: field_types.h:80
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:84
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:90
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:85
static int flag
Definition: hp_test1.cc:40
ha_key_alg
Definition: my_base.h:98
ha_rkey_function
Definition: my_base.h:78
my_off_t ha_rows
Definition: my_base.h:1141
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
const char * table_name
Definition: rules_table_service.cc:56
mode
Definition: file_handle.h:61
Definition: allocator.h:48
void kv_store_shards_debug_dump()
Small helper function which debug-prints the miscellaneous statistics which key-value store has colle...
Definition: handler.cc:56
Result
Definition: result.h:34
void shared_block_pool_release(THD *thd)
Small helper function which releases the slot (and memory occupied by the Block) in shared-block pool...
Definition: handler.cc:61
TempTable Table declarations.
Definition: handler.h:3803
Struct to hold information about the table that should be created.
Definition: handler.h:3210
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
This structure is shared between different table objects.
Definition: table.h:704
TABLE_SHARE * s
Definition: table.h:1422
Definition: thr_lock.h:124
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2740
thr_lock_type
Definition: thr_lock.h:51