27#ifndef TEMPTABLE_TABLE_H
28#define TEMPTABLE_TABLE_H
50 bool all_columns_are_fixed_size,
size_t tmp_table_size_limit);
89 const unsigned char *mysql_row);
100 const unsigned char *mysql_row_old,
102 const unsigned char *mysql_row_new,
148 const unsigned char *mysql_row_new)
const;
209 unsigned char *mysql_row)
const {
221 const Row *
row =
static_cast<const Row *
>(storage_element);
228 for (
auto element :
m_rows) {
239 entry.m_index->truncate();
266 entry.m_alloc_size =
sizeof(
T);
Custom memory allocator.
Definition: allocator.h:439
Memory-block abstraction whose purpose is to serve as a building block for custom memory-allocator im...
Definition: block.h:163
A column class that describes the metadata of a column.
Definition: column.h:41
Index interface.
Definition: index.h:45
A row representation.
Definition: row.h:402
Iterator over a Storage object.
Definition: storage.h:51
Storage container.
Definition: storage.h:43
size_t size() const
Get the number of elements in the storage.
Definition: storage.h:509
void clear()
Delete all elements in the storage.
Definition: storage.h:618
void element_size(size_t element_size)
Set the element size.
Definition: storage.h:489
void Element
Type used for elements.
Definition: storage.h:46
Definition: allocator.h:126
void row(const Storage::Iterator &pos, unsigned char *mysql_row) const
Definition: table.h:208
size_t number_of_indexes() const
Definition: table.h:187
Result disable_indexes()
Definition: table.h:243
bool indexed() const
Check if the table is indexed.
Definition: table.h:257
void append_new_index(const KEY &mysql_index)
Create index for given key and append it to indexes table.
Definition: table.h:263
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:57
Storage m_rows
Rows of the table.
Definition: table.h:160
Table & operator=(const Table &)=delete
TableResourceMonitor m_resource_monitor
Definition: table.h:154
bool m_indexes_are_enabled
Definition: table.h:164
my_thread_id m_owner_id
Definition: table.h:176
Result indexes_insert(Storage::Element *row)
Definition: table.cc:326
const Columns & columns() const
Definition: table.h:193
const Index & index(size_t i) const
Definition: table.h:197
std::vector< Index_entry, Allocator< Index_entry > > m_index_entries
Definition: table.h:168
Result indexes_remove(Storage::Element *row)
Definition: table.cc:368
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:178
void truncate()
Definition: table.h:226
uint32_t m_mysql_row_length
Definition: table.h:166
Table & operator=(Table &&rhs)=delete
bool m_all_columns_are_fixed_size
Definition: table.h:162
Table(Table &&other)=delete
Result insert(const unsigned char *mysql_row)
Insert a new row in the table.
Definition: table.cc:131
Result remove(const unsigned char *mysql_row_must_be, const Storage::Iterator &victim_position)
Definition: table.cc:233
Result enable_indexes()
Definition: table.h:248
~Table()
Definition: table.cc:120
void indexes_destroy()
Destroy the indexes in m_index_entries.
Definition: table.cc:298
const Column & column(size_t i) const
Definition: table.h:201
size_t mysql_row_length() const
Definition: table.h:185
Allocator< uint8_t > m_allocator
Allocator for all members that need dynamic memory allocation.
Definition: table.h:157
size_t number_of_columns() const
Definition: table.h:191
my_thread_id owner_id() const
Returns the ID of the owner THD.
Definition: table.cc:267
std::vector< Cursor, Allocator< Cursor > > m_insert_undo
Definition: table.h:170
const TABLE_SHARE * mysql_table_share() const
Definition: table.h:181
TABLE_SHARE * m_mysql_table_share
Definition: table.h:174
const Storage & rows() const
Definition: table.h:206
void indexes_create()
Create the indexes in m_index_entries from m_mysql_table->key_info[].
Definition: table.cc:269
size_t number_of_rows() const
Definition: table.h:195
bool is_index_update_needed(const unsigned char *mysql_row_old, const unsigned char *mysql_row_new) const
Definition: table.cc:311
Columns m_columns
Definition: table.h:172
#define T
Definition: jit_executor_value.cc:373
uint32 my_thread_id
Definition: my_thread_local.h:34
Definition: allocator.h:48
Result
Definition: result.h:34
std::vector< Column, Allocator< Column > > Columns
A type that designates all the columns of a table.
Definition: column.h:227
TempTable custom allocator.
TempTable Column declaration.
TempTable Index declarations.
TempTable auxiliary Result enum.
TempTable Row declarations.
This structure is shared between different table objects.
Definition: table.h:716
uint rec_buff_length
Definition: table.h:862
Definition: completion_hash.h:35
Index entry for storing index pointer as well as allocated memory size.
Definition: table.h:123
size_t m_alloc_size
Definition: table.h:126
Index * m_index
Definition: table.h:124