26#ifndef TEMPTABLE_TABLE_H
27#define TEMPTABLE_TABLE_H
49 bool all_columns_are_fixed_size,
size_t tmp_table_size_limit);
88 const unsigned char *mysql_row);
99 const unsigned char *mysql_row_old,
101 const unsigned char *mysql_row_new,
143 const unsigned char *mysql_row_new)
const;
202 unsigned char *mysql_row)
const {
214 const Row *
row =
static_cast<const Row *
>(storage_element);
221 for (
auto element :
m_rows) {
232 entry.m_index->truncate();
259 entry.m_alloc_size =
sizeof(T);
TempTable custom allocator.
Custom memory allocator.
Definition: allocator.h:389
Memory-block abstraction whose purpose is to serve as a building block for custom memory-allocator im...
Definition: block.h:162
A column class that describes the metadata of a column.
Definition: column.h:40
Index interface.
Definition: index.h:44
A row representation.
Definition: row.h:401
Iterator over a Storage object.
Definition: storage.h:50
Storage container.
Definition: storage.h:42
size_t size() const
Get the number of elements in the storage.
Definition: storage.h:508
void clear()
Delete all elements in the storage.
Definition: storage.h:617
void element_size(size_t element_size)
Set the element size.
Definition: storage.h:488
void Element
Type used for elements.
Definition: storage.h:45
Definition: allocator.h:127
void row(const Storage::Iterator &pos, unsigned char *mysql_row) const
Definition: table.h:201
size_t number_of_indexes() const
Definition: table.h:180
Result disable_indexes()
Definition: table.h:236
bool indexed() const
Check if the table is indexed.
Definition: table.h:250
void append_new_index(const KEY &mysql_index)
Create index for given key and append it to indexes table.
Definition: table.h:256
Table(const Table &)=delete
Table(TABLE *mysql_table, Block *shared_block, bool all_columns_are_fixed_size, size_t tmp_table_size_limit)
Definition: table.cc:49
Storage m_rows
Rows of the table.
Definition: table.h:155
Table & operator=(const Table &)=delete
TableResourceMonitor m_resource_monitor
Definition: table.h:149
bool m_indexes_are_enabled
Definition: table.h:159
Result indexes_insert(Storage::Element *row)
Definition: table.cc:315
const Columns & columns() const
Definition: table.h:186
const Index & index(size_t i) const
Definition: table.h:190
std::vector< Index_entry, Allocator< Index_entry > > m_index_entries
Definition: table.h:163
Result indexes_remove(Storage::Element *row)
Definition: table.cc:357
Result update(const unsigned char *mysql_row_old, const unsigned char *mysql_row_new, Storage::Element *target_row)
Update a row in the table.
Definition: table.cc:169
void truncate()
Definition: table.h:219
uint32_t m_mysql_row_length
Definition: table.h:161
Table & operator=(Table &&rhs)=delete
bool m_all_columns_are_fixed_size
Definition: table.h:157
Table(Table &&other)=delete
Result insert(const unsigned char *mysql_row)
Insert a new row in the table.
Definition: table.cc:122
Result remove(const unsigned char *mysql_row_must_be, const Storage::Iterator &victim_position)
Definition: table.cc:224
Result enable_indexes()
Definition: table.h:241
~Table()
Definition: table.cc:111
void indexes_destroy()
Destroy the indexes in m_index_entries.
Definition: table.cc:287
const Column & column(size_t i) const
Definition: table.h:194
size_t mysql_row_length() const
Definition: table.h:178
Allocator< uint8_t > m_allocator
Allocator for all members that need dynamic memory allocation.
Definition: table.h:152
size_t number_of_columns() const
Definition: table.h:184
std::vector< Cursor, Allocator< Cursor > > m_insert_undo
Definition: table.h:165
const TABLE_SHARE * mysql_table_share() const
Definition: table.h:174
TABLE_SHARE * m_mysql_table_share
Definition: table.h:169
const Storage & rows() const
Definition: table.h:199
void indexes_create()
Create the indexes in m_index_entries from m_mysql_table->key_info[].
Definition: table.cc:258
size_t number_of_rows() const
Definition: table.h:188
bool is_index_update_needed(const unsigned char *mysql_row_old, const unsigned char *mysql_row_new) const
Definition: table.cc:300
Columns m_columns
Definition: table.h:167
Definition: allocator.h:44
Result
Definition: result.h:33
std::vector< Column, Allocator< Column > > Columns
A type that designates all the columns of a table.
Definition: column.h:226
TempTable Column declaration.
TempTable Index declarations.
TempTable auxiliary Result enum.
TempTable Row declarations.
This structure is shared between different table objects.
Definition: table.h:688
uint rec_buff_length
Definition: table.h:838
Definition: completion_hash.h:34
Index entry for storing index pointer as well as allocated memory size.
Definition: table.h:118
size_t m_alloc_size
Definition: table.h:121
Index * m_index
Definition: table.h:119