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:4571
TABLE_SHARE * table_share
Definition: handler.h:4578
ulonglong Table_flags
Definition: handler.h:4575
TABLE * table
Definition: handler.h:4579
virtual ha_rows estimate_rows_upper_bound()
Return upper bound of current number of records in the table (max.
Definition: handler.h:5522
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:1033
int enable_indexes(uint mode) override
Enable indexes.
Definition: handler.cc:976
~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:150
int open(const char *table_name, int, uint, const dd::Table *) override
Open an existing table.
Definition: handler.cc:240
int index_prev(uchar *mysql_row) override
Step to the previous row in index order.
Definition: handler.cc:634
uint max_supported_key_length() const override
Get the maximum supported index length in bytes.
Definition: handler.cc:893
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:1009
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:1021
ulong index_flags(uint index_no, uint, bool) const override
Get the flags for a given index.
Definition: handler.cc:847
int write_row(uchar *mysql_row) override
Insert a new row to the currently opened table.
Definition: handler.cc:702
bool check_if_incompatible_data(HA_CREATE_INFO *, uint) override
Not implemented.
Definition: handler.cc:1091
int index_end() override
End an index scan.
Definition: handler.cc:668
int index_init(uint index_no, bool) override
Set the index to be used by subsequent index_*() calls.
Definition: handler.cc:395
bool primary_key_is_clustered() const override
Not implemented.
Definition: handler.cc:1080
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:359
void update_create_info(HA_CREATE_INFO *) override
Not implemented.
Definition: handler.cc:1057
int rnd_init(bool) override
Begin a table scan.
Definition: handler.cc:290
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:538
int rename_table(const char *, const char *, const dd::Table *, dd::Table *) override
Not implemented.
Definition: handler.cc:1062
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:621
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:684
int delete_row(const uchar *mysql_row) override
Delete the row where the handler is currently positioned.
Definition: handler.cc:737
handler * clone(const char *, MEM_ROOT *) override
Not implemented.
Definition: handler.cc:1003
double scan_time() override
Scan time.
Definition: handler.cc:935
int records(ha_rows *) override
Not implemented.
Definition: handler.cc:1051
int delete_table(const char *table_name, const dd::Table *) override
Delete a table.
Definition: handler.cc:205
int external_lock(THD *, int) override
Not implemented.
Definition: handler.cc:995
int reset() override
Not implemented.
Definition: handler.cc:1045
int disable_indexes(uint mode) override
Disable indexes.
Definition: handler.cc:957
const char * table_type() const override
Get the name of the storage engine.
Definition: handler.cc:822
Result index_next_conditional(uchar *mysql_row, NextCondition condition)
Advance the index cursor and read the row at that position, conditionally.
Definition: handler.cc:551
THR_LOCK_DATA ** store_lock(THD *, THR_LOCK_DATA **, thr_lock_type) override
Not implemented.
Definition: handler.cc:930
int start_stmt(THD *, thr_lock_type) override
Not implemented.
Definition: handler.cc:1039
int close() override
Close the opened table.
Definition: handler.cc:270
double read_time(uint, uint, ha_rows rows) override
Read time.
Definition: handler.cc:946
int optimize(THD *, HA_CHECK_OPT *) override
Not implemented.
Definition: handler.cc:1027
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:903
bool is_index_algorithm_supported(ha_key_alg algorithm) const override
Check whether an index algorithm is supported.
Definition: handler.cc:888
longlong get_memory_buffer_size() const override
Get the limit on the memory usage.
Definition: handler.cc:813
void unlock_row() override
Not implemented.
Definition: handler.cc:1001
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:765
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:1085
int index_last(uchar *) override
Not implemented.
Definition: handler.cc:1015
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:827
int index_next(uchar *mysql_row) override
Advance the index cursor and read the row at that position.
Definition: handler.cc:526
int info(uint flag) override
Refresh table stats.
Definition: handler.cc:789
bool get_error_message(int, String *) override
Not implemented.
Definition: handler.cc:1074
int rnd_next(uchar *mysql_row) override
Advance the cursor to the next row in insertion order and retrieve it.
Definition: handler.cc:304
Handler(handlerton *hton, TABLE_SHARE *table_share)
Constructor.
Definition: handler.cc:113
int rnd_end() override
End a table scan.
Definition: handler.cc:381
void init_table_handle_for_HANDLER() override
Not implemented.
Definition: handler.cc:1069
ha_key_alg get_default_index_algorithm() const override
Get the default index algorithm.
Definition: handler.cc:883
int update_row(const uchar *mysql_row_old, uchar *mysql_row_new) override
Update a row.
Definition: handler.cc:714
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:415
int delete_all_rows() override
Delete all rows in the table.
Definition: handler.cc:784
Iterator over a Storage object.
Definition: storage.h:51
const TABLE_SHARE * mysql_table_share() const
Definition: table.h:181
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:71
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:85
@ MYSQL_TYPE_BLOB
Definition: field_types.h:86
@ MYSQL_TYPE_JSON
Definition: field_types.h:79
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:83
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:89
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:84
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:45
Result
Definition: result.h:34
void close_connection(THD *thd)
Helper function that performs the temptable related cleanup.
Definition: handler.cc:97
TempTable Table declarations.
Definition: handler.h:3791
Struct to hold information about the table that should be created.
Definition: handler.h:3202
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:702
TABLE_SHARE * s
Definition: table.h:1408
Definition: thr_lock.h:124
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2734
thr_lock_type
Definition: thr_lock.h:51