82class Dictionary_client;
111 ulong
index_flags(uint idx, uint part,
bool all_parts)
const override;
120 int open(
const char *
name,
int, uint open_flags,
125 int close(
void)
override;
150 int index_init(uint index,
bool sorted)
override;
170 bool eq_range_arg,
bool sorted)
override;
195 int info(uint)
override;
209 int reset()
override;
222 int sample_init(
void *&scan_ctx,
double sampling_percentage,
224 const bool tablesample)
override;
451 bool use_reserved_threads,
452 size_t max_desired_threads)
override;
489 size_t num_threads)
override;
512 uint table_changes)
override;
520 uint n_ranges, uint
mode,
530 void *seq_init_param, uint n_ranges,
531 uint *bufsz, uint *
flags,
537 uint *bufsz, uint *
flags,
631 template <
typename Table>
634 const Table *old_dd_tab,
648 template <
typename Table>
666 template <
typename Table>
669 bool commit, Table *new_dd_tab);
677 void mv_key_capacity(uint *num_keys,
size_t *keys_length)
const override;
817 if (tablespace_name !=
nullptr && tablespace_name[0] !=
'\0' &&
841 my_error(ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE,
MYF(0),
844 return ER_INNODB_AUTOEXTEND_SIZE_OUT_OF_RANGE;
848 my_error(ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE,
MYF(0),
850 return ER_INNODB_INVALID_AUTOEXTEND_SIZE_VALUE;
877 char *
table_name,
char *remote_path,
char *tablespace,
878 bool file_per_table,
bool skip_strict, uint32_t old_flags,
913 template <
typename Table>
1097 template <
typename Table>
1100 bool file_per_table,
bool evictable,
bool skip_strict,
1101 uint32_t old_flags, uint32_t old_flags2,
1113 template <
typename Table>
1130 template <
typename Table>
1131 static int rename_impl(
THD *thd,
const char *from,
const char *to,
1132 const Table *from_table,
const Table *to_table,
1137template <
typename Table>
1148 bool keep_autoinc,
bool table_truncate)
1256 const TABLE *altered_table,
1258 ulint *fts_doc_col_no);
1268 const KEY *key_info);
1357 const char *share_tbl_name);
uint32_t page_no_t
Page number.
Definition: api0api.h:45
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Class describing changes to be done by ALTER TABLE.
Definition: handler.h:3353
Used to store optimizer cost estimates.
Definition: handler.h:3865
Definition: handler.h:7271
virtual bool is_array() const
Whether the field is a typed array.
Definition: field.h:1801
Value_generator * gcol_info
Definition: field.h:813
bool stored_in_db
Indication that the field is physically stored in tables rather than just generated on SQL queries.
Definition: field.h:819
Wrapper for struct ft_hints.
Definition: handler.h:4125
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Definition: sql_list.h:467
Traverse an index in the leaf page block list order and send records to adapter.
Definition: row0pread-adapter.h:43
handler::Load_init_cbk Init_fn
Definition: row0pread-adapter.h:55
handler::Load_end_cbk End_fn
Definition: row0pread-adapter.h:53
handler::Load_cbk Load_fn
Definition: row0pread-adapter.h:51
Implements the row and column memory management for parse and load operations.
Definition: bulk_data_service.h:86
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
Class for handling create table information.
Definition: ha_innodb.h:870
bool is_intrinsic_temp_table() const
Definition: ha_innodb.h:977
bool m_use_file_per_table
After all considerations, this shows whether we will actually create a table and tablespace using fil...
Definition: ha_innodb.h:1053
int prepare_create_table(const char *name)
Prepare to create a table.
Definition: ha_innodb.cc:13854
const char * table_name() const
Return table name.
Definition: ha_innodb.h:973
uint32_t m_flags
Table flags.
Definition: ha_innodb.h:1062
THD * m_thd
Connection thread handle.
Definition: ha_innodb.h:1019
bool create_option_tablespace_is_valid()
Validate TABLESPACE option.
Definition: ha_innodb.cc:12592
char * m_remote_path
Remote path (DATA DIRECTORY) or zero length-string.
Definition: ha_innodb.h:1033
int create_table_update_global_dd(Table *dd_table)
Update the global data dictionary.
Definition: ha_innodb.cc:14227
bool create_option_compression_is_valid()
Validate COMPRESSION option.
Definition: ha_innodb.cc:12835
void flags2_reset()
Reset table flags2.
Definition: ha_innodb.h:967
void initialize_autoinc()
Initialize the autoinc of this table if necessary, which should be called before we flush logs,...
Definition: ha_innodb.cc:13791
HA_CREATE_INFO * m_create_info
Create options.
Definition: ha_innodb.h:1028
bool is_temp_table() const
Definition: ha_innodb.h:984
int initialize()
Initialize the object.
Definition: ha_innodb.cc:13763
dict_table_t * m_table
The newly created InnoDB table object.
Definition: ha_innodb.h:1040
void detach()
Detach the just created table and its auxiliary tables if exist.
Definition: ha_innodb.cc:13602
trx_t * m_trx
InnoDB transaction handle.
Definition: ha_innodb.h:1022
bool m_partition
True if this table is a partition.
Definition: ha_innodb.h:1071
uint32_t flags2() const
Get table flags2.
Definition: ha_innodb.h:961
int create_table(const dd::Table *dd_table, const dd::Table *old_part_table)
Create the internal innodb table.
Definition: ha_innodb.cc:13968
static bool normalize_table_name(char *norm_name, const char *name)
Normalizes a table name string.
Definition: ha_innodb.cc:6650
bool m_use_data_dir
Using DATA DIRECTORY.
Definition: ha_innodb.h:1056
char * m_tablespace
Tablespace name or zero length-string.
Definition: ha_innodb.h:1035
bool m_allow_file_per_table
Allow file_per_table for this table either because: 1) the setting innodb_file_per_table=on,...
Definition: ha_innodb.h:1049
bool m_use_shared_space
Using a Shared General Tablespace.
Definition: ha_innodb.h:1059
uint32_t m_flags2
Table flags2.
Definition: ha_innodb.h:1065
bool m_skip_strict
Skip strict check.
Definition: ha_innodb.h:1068
int parse_table_name(const char *name)
Parses the table name into normal name and either temp path or remote path if needed.
Definition: ha_innodb.cc:13268
create_table_info_t(THD *thd, TABLE *form, HA_CREATE_INFO *create_info, char *table_name, char *remote_path, char *tablespace, bool file_per_table, bool skip_strict, uint32_t old_flags, uint32_t old_flags2, bool is_partition)
Constructor.
Definition: ha_innodb.h:876
int create_table_update_dict()
Update the internal data dictionary.
Definition: ha_innodb.cc:14176
void set_tablespace_type(bool table_being_altered_is_file_per_table)
Set m_tablespace_type.
Definition: ha_innodb.cc:13732
bool m_innodb_file_per_table
Local copy of srv_file_per_table.
Definition: ha_innodb.h:1043
bool innobase_table_flags()
Determine InnoDB table flags.
Definition: ha_innodb.cc:13336
const TABLE * m_form
Information on table columns and indexes.
Definition: ha_innodb.h:1025
void set_remote_path_flags()
Set flags and append '/' to remote path if necessary.
Definition: ha_innopart.cc:2375
char * m_table_name
Table name.
Definition: ha_innodb.h:1031
void log_error_invalid_location(std::string &msg, bool ignore)
Put a warning or error message to the error log for the DATA DIRECTORY option.
Definition: ha_innodb.cc:12404
uint32_t flags() const
Get table flags.
Definition: ha_innodb.h:958
bool skip_strict() const
whether to skip strict check.
Definition: ha_innodb.h:970
void flags_reset()
Reset table flags.
Definition: ha_innodb.h:964
THD * thd() const
Definition: ha_innodb.h:975
const char * create_options_are_invalid()
Validates the create options.
Definition: ha_innodb.cc:12899
bool create_option_data_directory_is_valid(bool ignore=false)
Validate DATA DIRECTORY option.
Definition: ha_innodb.cc:12425
int create_table_def(const dd::Table *dd_table, const dd::Table *old_part_table)
Create a table definition to an InnoDB database.
Definition: ha_innodb.cc:11557
The class defining a handle to an InnoDB table.
Definition: ha_innodb.h:87
THD * m_user_thd
Thread handle of the user currently using the handler; this is set in external_lock function.
Definition: ha_innodb.h:691
void mv_key_capacity(uint *num_keys, size_t *keys_length) const override
Return max limits for a single set of multi-valued keys.
Definition: ha_innodb.cc:24049
int reset() override
MySQL calls this method at the end of each statement.
Definition: ha_innodb.cc:18668
int ft_init() override
Initialize FT index scan.
Definition: ha_innodb.cc:11100
int parallel_scan_init(void *&scan_ctx, size_t *num_threads, bool use_reserved_threads, size_t max_desired_threads) override
Initializes a parallel scan.
Definition: handler0alter.cc:1458
Table_flags table_flags() const override
Get the table flags to use for the statement.
Definition: ha_innodb.cc:6539
DsMrr_impl m_ds_mrr
The multi range read session object.
Definition: ha_innodb.h:684
int disable_indexes(uint mode) override
Disable indexes.
Definition: ha_innodb.cc:18273
int sample_init(void *&scan_ctx, double sampling_percentage, int sampling_seed, enum_sampling_method sampling_method, const bool tablesample) override
Initialize sampling.
Definition: ha_innodb.cc:10895
int delete_table(const char *name, const dd::Table *table_def, enum enum_sql_command sqlcom)
Drop a table.
uchar * m_upd_buf
buffer used in updates
Definition: ha_innodb.h:697
Item * idx_cond_push(uint keyno, Item *idx_cond) override
Attempt to push down an index condition.
Definition: ha_innodb.cc:24007
int general_fetch(uchar *buf, uint direction, uint match_mode)
Reads the next or previous row from a cursor, which must have previously been positioned using index_...
Definition: ha_innodb.cc:10737
uint m_last_match_mode
Definition: ha_innodb.h:711
int rnd_pos(uchar *buf, uchar *pos) override
Fetches a row from the table based on a row reference.
Definition: ha_innodb.cc:11069
int extra(ha_extra_function operation) override
Tells something additional to the handler about how to do things.
Definition: ha_innodb.cc:18547
void build_template(bool whole_row)
Builds a 'template' to the m_prebuilt struct.
Definition: ha_innodb.cc:8587
int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info, dd::Table *table_def) override
Create an InnoDB table.
Definition: ha_innodb.cc:15304
bool is_record_buffer_wanted(ha_rows *const max_rows) const override
Find out if a Record_buffer is wanted by this handler, and what is the maximum buffer size the handle...
Definition: ha_innodb.cc:24026
double scan_time() override
How many seeks it will take to read through the table.
Definition: ha_innodb.cc:17064
void innobase_initialize_autoinc()
Set the autoinc column max value.
Definition: ha_innodb.cc:7267
int discard_or_import_tablespace(bool discard, dd::Table *table_def) override
Discards or imports an InnoDB tablespace.
Definition: ha_innodb.cc:15337
handler * clone(const char *name, MEM_ROOT *mem_root) override
Definition: ha_innodb.cc:7856
void srv_concurrency_exit()
Leave Innodb, if no more tickets are left.
Definition: ha_innodb.cc:2934
ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, uint *bufsz, uint *flags, Cost_estimate *cost) override
Initialize multi range read and get information.
Definition: ha_innodb.cc:23679
bool primary_key_is_clustered() const override
Determines if the primary key is clustered index.
Definition: ha_innodb.cc:6648
int intrinsic_table_write_row(uchar *record)
Write Row Interface optimized for Intrinsic table.
Definition: ha_innodb.cc:8979
int start_stmt(THD *thd, thr_lock_type lock_type) override
MySQL calls this function at the start of each SQL statement inside LOCK TABLES.
Definition: ha_innodb.cc:18682
ulong index_flags(uint idx, uint part, bool all_parts) const override
Returns the operations supported for indexes.
Definition: ha_innodb.cc:6578
int rnd_end() override
Ends a table scan.
Definition: ha_innodb.cc:11034
int update_row(const uchar *old_data, uchar *new_data) override
Updates a row given as a parameter to a new value.
Definition: ha_innodb.cc:9967
int index_end() override
Currently does nothing.
Definition: ha_innodb.cc:10277
ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) override
Estimates the number of index records in a range.
Definition: ha_innodb.cc:16897
virtual dict_index_t * innobase_get_index(uint keynr)
Get the index for a handle.
Definition: ha_innodb.cc:10592
uint max_supported_key_part_length(HA_CREATE_INFO *create_info) const override
Definition: ha_innodb.cc:7873
int get_extra_columns_and_keys(const HA_CREATE_INFO *, const List< Create_field > *, const KEY *, uint, dd::Table *dd_table) override
Add hidden columns and indexes to an InnoDB table definition.
Definition: ha_innodb.cc:14992
int multi_range_read_next(char **range_info) override
Process next multi range read.
Definition: ha_innodb.cc:23663
row_prebuilt_t * m_prebuilt
Save CPU time with prebuilt/cached data structures.
Definition: ha_innodb.h:687
bool m_mysql_has_locked
If mysql has locked with external_lock()
Definition: ha_innodb.h:719
int index_next_same(uchar *buf, const uchar *key, uint keylen) override
Reads the next row matching to the key value given as the parameter.
Definition: ha_innodb.cc:10832
int rnd_next(uchar *buf) override
Reads the next row in a table scan (also used to read the FIRST row in a table scan).
Definition: ha_innodb.cc:11040
bool prepare_inplace_alter_table_impl(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const Table *old_dd_tab, Table *new_dd_tab)
Implementation of prepare_inplace_alter_table()
Definition: handler0alter.cc:5417
int enable_indexes(uint mode) override
Enable indexes.
Definition: ha_innodb.cc:18247
ha_innobase(handlerton *hton, TABLE_SHARE *table_arg)
Construct ha_innobase handler.
Definition: ha_innodb.cc:2940
void update_thd()
Updates the user_thd field in a handle and also allocates a new InnoDB transaction handle if needed,...
Definition: ha_innodb.cc:2990
int rnd_init(bool scan) override
Initialize a table scan.
Definition: ha_innodb.cc:11013
int index_next(uchar *buf) override
Reads the next row from a cursor, which must have previously been positioned using index_read.
Definition: ha_innodb.cc:10821
INNOBASE_SHARE * m_share
information for MySQL table locking
Definition: ha_innodb.h:694
int parallel_scan(void *scan_ctx, void **thread_ctxs, Reader::Init_fn init_fn, Reader::Load_fn load_fn, Reader::End_fn end_fn) override
Start parallel read of InnoDB records.
Definition: handler0alter.cc:1527
int bulk_load_end(THD *thd, void *load_ctx, bool is_error) override
End bulk load operation.
Definition: handler0alter.cc:11195
ulint m_stored_select_lock_type
this field is used to remember the original select_lock_type that was decided in ha_innodb....
Definition: ha_innodb.h:716
dberr_t innobase_set_max_autoinc(ulonglong auto_inc)
Store the autoinc value in the table.
Definition: ha_innodb.cc:8960
virtual bool can_reuse_mysql_template() const
Can reuse the template.
Definition: ha_innodb.h:681
void position(const uchar *record) override
Store a reference to the current row to 'ref' field of the handle.
Definition: ha_innodb.cc:11455
int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf) override
Initialize multi range read.
Definition: ha_innodb.cc:23655
void unlock_row() override
Removes a new lock set on a row, if it was not read optimistically.
Definition: ha_innodb.cc:10197
bool commit_inplace_alter_table_impl(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, Table *new_dd_tab)
Implementation of commit_inplace_alter_table()
Definition: handler0alter.cc:7402
bool m_start_of_scan
this is set to 1 when we are starting a table scan but have not yet fetched any row,...
Definition: ha_innodb.h:707
int rename_table(const char *from, const char *to, const dd::Table *from_table, dd::Table *to_table) override
Renames an InnoDB table.
Definition: ha_innodb.cc:16768
void position(uchar *record)
bool was_semi_consistent_read() override
Definition: ha_innodb.cc:10245
int close(void) override
Closes a handle to an InnoDB table.
Definition: ha_innodb.cc:7890
int srv_concurrency_enter()
Enter InnoDB engine after checking max allowed threads.
Definition: ha_innodb.cc:2927
int end_stmt()
MySQL calls this method at the end of each statement.
Definition: ha_innodb.cc:18626
bool get_se_private_data(dd::Table *dd_table, bool reset) override
Get storage-engine private data for a data dictionary table.
Definition: ha_innodb.cc:15226
bool is_index_algorithm_supported(enum ha_key_alg key_alg) const override
Check if SE supports specific key algorithm.
Definition: ha_innodb.h:101
ha_rows estimate_rows_upper_bound() override
Gives an UPPER BOUND to the number of rows in a table.
Definition: ha_innodb.cc:17017
void ft_end()
Definition: ha_innodb.cc:11440
bool get_error_message(int error, String *buf) override
See comment in handler.cc.
Definition: ha_innodb.cc:20005
int open(const char *name, int, uint open_flags, const dd::Table *table_def) override
Open an InnoDB table.
Definition: ha_innodb.cc:7388
uint max_supported_key_length() const override
Returns the maximum key length.
Definition: ha_innodb.cc:6622
longlong get_memory_buffer_size() const override
Return the size of the InnoDB memory buffer.
Definition: ha_innodb.cc:17128
int change_active_index(uint keynr)
Changes the active index of a handle.
Definition: ha_innodb.cc:10636
int records(ha_rows *num_rows) override
Returns the exact number of records that this client can see using this handler object.
Definition: ha_innodb.cc:16806
THR_LOCK_DATA ** store_lock(THD *thd, THR_LOCK_DATA **to, thr_lock_type lock_type) override
Supposed to convert a MySQL table lock stored in the 'lock' field of the handle to a proper type befo...
Definition: ha_innodb.cc:19650
uint lock_count(void) const override
Returns number of THR_LOCK locks used for one instance of InnoDB table.
Definition: ha_innodb.cc:19634
bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes) override
Part of old, deprecated in-place ALTER API.
Definition: ha_innodb.cc:20408
dberr_t innobase_get_autoinc(ulonglong *value)
Read the next autoinc value.
Definition: ha_innodb.cc:19828
void reset_template()
Resets a query execution 'template'.
Definition: ha_innodb.cc:3140
ulint m_upd_buf_size
the size of upd_buf in bytes
Definition: ha_innodb.h:700
void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values) override
Returns the value of the auto-inc counter in *first_value and ~0 on failure.
Definition: ha_innodb.cc:19866
size_t bulk_load_available_memory(THD *thd) const override
Get the total memory available for bulk load in innodb buffer pool.
Definition: handler0alter.cc:11124
int info(uint) override
Returns statistics information of the table to the MySQL interpreter, in various fields of the handle...
Definition: ha_innodb.cc:17719
int delete_table(const char *name, const dd::Table *table_def) override
Drop a table.
Definition: ha_innodb.cc:15537
FT_INFO * ft_init_ext(uint flags, uint inx, String *key) override
Initialize FT index scan.
Definition: ha_innodb.cc:11120
uint max_supported_keys() const override
Returns the maximum number of keys.
Definition: ha_innodb.cc:6617
int external_lock(THD *thd, int lock_type) override
As MySQL will execute an external lock for every new table it uses when it starts to process an SQL s...
Definition: ha_innodb.cc:18826
int cmp_ref(const uchar *ref1, const uchar *ref2) const override
Compares two 'refs'.
Definition: ha_innodb.cc:20073
int analyze(THD *thd, HA_CHECK_OPT *check_opt) override
Updates index cardinalities of the table, based on random dives into each index tree.
Definition: ha_innodb.cc:18301
int index_first(uchar *buf) override
Positions a cursor on the first record in an index and reads the corresponding row to buf.
Definition: ha_innodb.cc:10857
bool inplace_alter_table_impl(TABLE *altered_table, Alter_inplace_info *ha_alter_info)
Implementation of inplace_alter_table()
Definition: handler0alter.cc:6114
int ft_read(uchar *buf) override
Fetch next result from the FT result set.
Definition: ha_innodb.cc:11304
bool upgrade_table(THD *thd, const char *db_name, const char *table_name, dd::Table *dd_table) override
Set Engine specific data to dd::Table object for upgrade.
Definition: ha_innodb.cc:15216
void init_table_handle_for_HANDLER() override
Call this when you have opened a new table handle in HANDLER, before you call index_read_map() etc.
Definition: ha_innodb.cc:3170
int index_last(uchar *buf) override
Positions a cursor on the last record in an index and reads the corresponding row to buf.
Definition: ha_innodb.cc:10878
int truncate_impl(const char *name, TABLE *form, dd::Table *table_def)
TRUNCATE an InnoDB table.
Definition: ha_innodb.cc:15463
int sample_end(void *scan_ctx) override
End sampling.
Definition: ha_innodb.cc:10989
int index_init(uint index, bool sorted) override
Initializes a handle to use an index.
Definition: ha_innodb.cc:10264
int read_range_next() override
Read next row between two endpoints.
Definition: ha_innodb.cc:11004
Table_flags m_int_table_flags
Flags that specify the handler instance (table) capability.
Definition: ha_innodb.h:703
int index_read_last(uchar *buf, const uchar *key, uint key_len) override
The following functions works like index_read, but it find the last row with the current key value or...
Definition: ha_innodb.cc:10579
void try_semi_consistent_read(bool yes) override
Tell the engine whether it should avoid unnecessary lock waits.
Definition: ha_innodb.cc:10251
dberr_t innobase_lock_autoinc()
This special handling is really to overcome the limitations of MySQL's binlogging.
Definition: ha_innodb.cc:8894
row_type get_real_row_type(const HA_CREATE_INFO *create_info) const override
Get real row type for the table created based on one specified by user, CREATE TABLE options and SE c...
Definition: ha_innodb.cc:6489
FT_INFO * ft_init_ext_with_hints(uint inx, String *key, Ft_hints *hints) override
Initialize FT index scan.
Definition: ha_innodb.cc:11248
int index_read(uchar *buf, const uchar *key, uint key_len, ha_rkey_function find_flag) override
Positions an index cursor to the index specified in the handle.
Definition: ha_innodb.cc:10387
void parallel_scan_end(void *scan_ctx) override
End of the parallel scan.
Definition: handler0alter.cc:1550
void update_create_info(HA_CREATE_INFO *create_info) override
Update create_info.
Definition: ha_innodb.cc:13070
void release_auto_increment() override
Do cleanup for auto increment calculation.
Definition: ha_innodb.cc:19849
int index_prev(uchar *buf) override
Reads the previous row from a cursor, which must have previously been positioned using index_read.
Definition: ha_innodb.cc:10845
ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, uint *flags, Cost_estimate *cost) override
Initialize multi range read and get information.
Definition: ha_innodb.cc:23667
int write_row(uchar *buf) override
Stores a row in an InnoDB database, to the table specified in this handle.
Definition: ha_innodb.cc:9214
enum ha_key_alg get_default_index_algorithm() const override
Get default key algorithm for SE.
Definition: ha_innodb.h:96
int check(THD *thd, HA_CHECK_OPT *check_opt) override
Tries to check that an InnoDB table is not corrupted.
Definition: ha_innodb.cc:18350
int read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range_arg, bool sorted) override
Read first row between two ranges.
Definition: ha_innodb.cc:10997
int delete_all_rows() override
Delete all rows from the table.
Definition: ha_innodb.cc:10178
bool bulk_load_check(THD *thd) const override
Check if the table is ready for bulk load.
Definition: handler0alter.cc:11083
int bulk_load_execute(THD *thd, void *load_ctx, size_t thread_idx, const Rows_mysql &rows, Bulk_load::Stat_callbacks &wait_cbk) override
Execute bulk load operation.
Definition: handler0alter.cc:11173
virtual int info_low(uint flag, bool is_analyze)
Returns statistics information of the table to the MySQL interpreter, in various fields of the handle...
Definition: ha_innodb.cc:17403
int sample_next(void *scan_ctx, uchar *buf) override
Get the next record for sampling.
Definition: ha_innodb.cc:10972
const char * table_type() const override
Returns the table type (storage engine name).
Definition: ha_innodb.cc:6573
double read_time(uint index, uint ranges, ha_rows rows) override
Calculate the time it takes to read a set of ranges through an index This enables us to optimise read...
Definition: ha_innodb.cc:17098
int optimize(THD *thd, HA_CHECK_OPT *check_opt) override
This is mapped to "ALTER TABLE tablename ENGINE=InnoDB", which rebuilds the table in MySQL.
Definition: ha_innodb.cc:18319
bool get_foreign_dup_key(char *, uint, char *, uint) override
Retrieves the names of the table and the key for which there was a duplicate entry in the case of HA_...
Definition: ha_innodb.cc:20029
~ha_innobase() override=default
int delete_row(const uchar *buf) override
Deletes a row given as the parameter.
Definition: ha_innodb.cc:10125
void * bulk_load_begin(THD *thd, size_t data_size, size_t memory, size_t num_threads) override
Begin parallel bulk data load to the table.
Definition: handler0alter.cc:11130
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4573
ulonglong Table_flags
Definition: handler.h:4577
Class of basic DDL implementation, for CREATE/DROP/RENAME TABLE.
Definition: ha_innodb.h:1075
static int rename_impl(THD *thd, const char *from, const char *to, const Table *from_table, const Table *to_table, const TABLE *td)
Renames an InnoDB table.
Definition: ha_innodb.cc:14534
static int create_impl(THD *thd, const char *name, TABLE *form, HA_CREATE_INFO *create_info, Table *dd_tab, bool file_per_table, bool evictable, bool skip_strict, uint32_t old_flags, uint32_t old_flags2, const dd::Table *old_dd_table)
Create an InnoDB table.
Definition: ha_innodb.cc:14316
static int delete_impl(THD *thd, const char *name, const Table *dd_tab, const TABLE *td)
Drop an InnoDB table.
Definition: ha_innodb.cc:14431
Class to handle TRUNCATE for one InnoDB table or one partition.
Definition: ha_innodb.h:1138
dict_table_t * m_table
InnoDB table object for the table/partition.
Definition: ha_innodb.h:1208
trx_t * m_trx
Transaction attached to current thd.
Definition: ha_innodb.h:1205
int open_table(dict_table_t *&innodb_table)
Open the table/partition to be truncated.
Definition: ha_innodb.cc:14665
bool m_keep_autoinc
True if the original autoinc counter should be kept.
Definition: ha_innodb.h:1222
Table * m_dd_table
dd::Table or dd::Partition
Definition: ha_innodb.h:1202
int truncate()
Do the real truncation.
Definition: ha_innodb.cc:14763
uint32_t m_flags2
flags2 of the table to be truncated, which should not change
Definition: ha_innodb.h:1232
TABLE * m_form
Table format.
Definition: ha_innodb.h:1211
HA_CREATE_INFO m_create_info
Create information.
Definition: ha_innodb.h:1214
int rename_tablespace()
Rename tablespace file name.
Definition: ha_innodb.cc:14858
bool m_file_per_table
True if this table/partition is file per table.
Definition: ha_innodb.h:1217
int load_fk()
Reload the FK related information.
Definition: ha_innodb.cc:14922
int prepare()
Prepare for truncate.
Definition: ha_innodb.cc:14696
int exec()
Do the truncate of the table/partition.
Definition: ha_innodb.cc:14953
innobase_truncate(THD *thd, const char *name, TABLE *form, Table *dd_table, bool keep_autoinc, bool table_truncate)
Constructor.
Definition: ha_innodb.h:1147
~innobase_truncate()
Destructor.
Definition: ha_innodb.cc:14654
uint32_t m_flags
flags of the table to be truncated, which should not change
Definition: ha_innodb.h:1229
void cleanup()
Cleanup.
Definition: ha_innodb.cc:14905
bool m_table_truncate
For a prtition table, this is true if full table is truncated.
Definition: ha_innodb.h:1226
THD * m_thd
THD object.
Definition: ha_innodb.h:1196
const char * m_name
Normalized table name.
Definition: ha_innodb.h:1199
A table definition from the master.
Definition: rpl_utility.h:248
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
This service provides functions for clone plugin to connect and interact with remote server's clone p...
dberr_t
Definition: db0err.h:39
@ DB_SUCCESS
Definition: db0err.h:43
constexpr uint32_t DICT_TF2_TEMPORARY
TEMPORARY; true for tables from CREATE TEMPORARY TABLE.
Definition: dict0mem.h:269
constexpr uint32_t DICT_TF2_INTRINSIC
Intrinsic table bit Intrinsic table is table created internally by MySQL modules viz.
Definition: dict0mem.h:292
static page_no_t fsp_get_extent_size_in_pages(const page_size_t &page_size)
Calculate the number of physical pages in an extent for this file.
Definition: fsp0fsp.h:356
constexpr uint64_t FSP_MAX_AUTOEXTEND_SIZE
Definition: fsp0fsp.h:181
bool commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, const dd::Table *old_dd_tab, dd::Table *new_dd_tab) override
Commit or rollback the changes made during prepare_inplace_alter_table() and inplace_alter_table() in...
Definition: handler0alter.cc:1592
enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info *ha_alter_info) override
Check if InnoDB supports a particular alter table in-place.
Definition: handler0alter.cc:964
bool inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_dd_tab, dd::Table *new_dd_tab) override
Alter the table structure in-place with operations specified using HA_ALTER_FLAGS and Alter_inplace_i...
Definition: handler0alter.cc:1556
bool prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_dd_tab, dd::Table *new_dd_tab) override
Allows InnoDB to update internal structures with concurrent writes blocked (provided that check_if_su...
Definition: handler0alter.cc:1432
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:216
constexpr uint32_t FSP_FREE_ADD
This many free extents are added to the free list from above FSP_FREE_LIMIT at a time.
Definition: fsp0fsp.h:176
bool innobase_match_index_columns(const KEY *key_info, const dict_index_t *index_info)
Match index columns between MySQL and InnoDB.
Definition: ha_innodb.cc:6837
void innodb_base_col_setup_for_stored(const dict_table_t *table, const Field *field, dict_s_col_t *s_col)
Set up base columns for stored column.
Definition: ha_innodb.cc:11523
const struct _ft_vft ft_vft_result
Definition: ha_innodb.cc:595
static bool normalize_table_name(char *norm_name, const char *name)
Definition: ha_innodb.h:1307
static bool tablespace_is_shared_space(const HA_CREATE_INFO *create_info)
Check if table will be explicitly put in an existing shared general or system tablespace.
Definition: ha_innodb.h:791
rec_per_key_t innodb_rec_per_key(const dict_index_t *index, ulint i, ha_rows records)
Calculate Record Per Key value.
Definition: ha_innodb.cc:17229
static bool is_shared_tablespace(const char *tablespace_name)
Check if tablespace is shared tablespace.
Definition: ha_innodb.h:816
void innobase_discard_table(THD *thd, dict_table_t *table)
Drop the statistics for a specified table, and mark it as discard after DDL.
Definition: handler0alter.cc:705
int convert_error_code_to_mysql(dberr_t error, uint32_t flags, THD *thd)
Converts an InnoDB error code to a MySQL error code.
Definition: ha_innodb.cc:2078
const char innobase_index_reserve_name[]
"GEN_CLUST_INDEX" is the name reserved for InnoDB default system clustered index when there is no pri...
Definition: dict0mem.h:1030
void innobase_build_v_templ_callback(const TABLE *table, void *ib_table)
Callback used by MySQL server layer to initialize the table virtual columns' template.
Definition: ha_innodb.cc:6984
bool trx_is_registered_for_2pc(const trx_t *trx)
Note that a transaction has been registered with MySQL.
Definition: ha_innodb.h:1314
static int validate_autoextend_size_value(uint64_t ext_size)
Validate AUTOEXTEND_SIZE attribute for a tablespace.
Definition: ha_innodb.h:829
void innobase_parse_hint_from_comment(THD *thd, dict_table_t *table, const TABLE_SHARE *table_share)
Parse hint for table and its indexes, and update the information in dictionary.
Definition: ha_innodb.cc:13658
static bool tablespace_is_file_per_table(const HA_CREATE_INFO *create_info)
Check if the explicit tablespace targeted is file_per_table.
Definition: ha_innodb.h:780
void innodb_base_col_setup(dict_table_t *table, const Field *field, dict_v_col_t *v_col)
Set up base columns for virtual column.
Definition: ha_innodb.cc:11492
fts_doc_id_index_enum
Some defines for innobase_fts_check_doc_id_index() return value.
Definition: ha_innodb.h:1244
@ FTS_EXIST_DOC_ID_INDEX
Definition: ha_innodb.h:1246
@ FTS_INCORRECT_DOC_ID_INDEX
Definition: ha_innodb.h:1245
@ FTS_NOT_EXIST_DOC_ID_INDEX
Definition: ha_innodb.h:1247
trx_t * innobase_trx_allocate(THD *thd)
Allocates an InnoDB transaction for a MySQL handler object.
Definition: ha_innodb.cc:2753
void innobase_build_v_templ(const TABLE *table, const dict_table_t *ib_table, dict_vcol_templ_t *s_templ, const dict_add_v_col_t *add_v, bool locked, const char *share_tbl_name)
Build template for the virtual columns and their base columns.
Definition: ha_innodb.cc:7000
const mysql_service_clone_protocol_t * clone_protocol_svc
Clone protocol service.
Definition: ha_innodb.cc:279
static bool tablespace_is_general_space(const HA_CREATE_INFO *create_info)
Check if table will be explicitly put in a general tablespace.
Definition: ha_innodb.h:802
fts_doc_id_index_enum innobase_fts_check_doc_id_index(const dict_table_t *table, const TABLE *altered_table, ulint *fts_doc_col_no)
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME on the Doc ID column.
Definition: handler0alter.cc:2845
void innobase_register_trx(handlerton *hton, THD *thd, trx_t *trx)
Allocates an InnoDB transaction for a MySQL handler object for DML.
Definition: ha_innodb.cc:3003
static bool innobase_is_s_fld(const Field *field)
whether this is a stored column
Definition: ha_innodb.h:1294
static bool innobase_is_multi_value_fld(const Field *field)
Whether this is a computed multi-value virtual column.
Definition: ha_innodb.h:1303
void innobase_copy_frm_flags_from_table_share(dict_table_t *innodb_table, const TABLE_SHARE *table_share)
Copy table flags from MySQL's TABLE_SHARE into an InnoDB table object.
Definition: ha_innodb.cc:2902
bool innobase_fts_load_stopword(dict_table_t *table, trx_t *trx, THD *thd)
Initialize the table FTS stopword list.
Definition: ha_innodb.cc:13100
void(* my_gcolumn_templatecallback_t)(const TABLE *, void *)
Callback function definition, used by MySQL server layer to initialized the table virtual columns' te...
Definition: ha_innodb.h:1367
trx_t *& thd_to_trx(THD *thd)
Obtain the InnoDB transaction of a MySQL thread.
Definition: ha_innodb.cc:2011
page_cur_mode_t convert_search_mode_to_innobase(enum ha_rkey_function find_flag)
Converts a search mode flag understood by MySQL to a flag understood by InnoDB.
Definition: ha_innodb.cc:10295
fts_doc_id_index_enum innobase_fts_check_doc_id_index_in_def(ulint n_key, const KEY *key_info)
Check whether the table has a unique index with FTS_DOC_ID_INDEX_NAME on the Doc ID column in MySQL c...
Definition: handler0alter.cc:2931
struct new_ft_info NEW_FT_INFO
Structure Returned by ha_innobase::ft_init_ext()
trx_t::isolation_level_t innobase_trx_map_isolation_level(enum_tx_isolation iso)
Maps a MySQL trx isolation level code to the InnoDB isolation level code.
Definition: ha_innodb.cc:18793
bool innobase_index_name_is_reserved(THD *thd, const KEY *key_info, ulint num_of_keys)
This function checks each index name for a table against reserved system default primary index name '...
Definition: ha_innodb.cc:21714
constexpr uint32_t SIZE_MB
Definition: ha_innodb.h:824
bool innobase_stats_on_metadata
Definition: ha_innodb.cc:347
ulong thd_parallel_read_threads(THD *thd)
Return the number of read threads for this session.
Definition: ha_innodb.cc:2018
static int flags[50]
Definition: hp_test1.cc:40
static int flag
Definition: hp_test1.cc:40
static uint keys
Definition: hp_test2.cc:49
float rec_per_key_t
Data type for records per key estimates that are stored in the KEY::rec_per_key_float[] array.
Definition: key.h:96
ha_key_alg
Definition: my_base.h:98
@ HA_KEY_ALG_RTREE
Definition: my_base.h:109
@ HA_KEY_ALG_BTREE
Definition: my_base.h:108
@ HA_KEY_ALG_FULLTEXT
Definition: my_base.h:111
ha_rkey_function
Definition: my_base.h:78
my_off_t ha_rows
Definition: my_base.h:1141
ha_extra_function
Definition: my_base.h:185
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
#define MYF(v)
Definition: my_inttypes.h:97
enum_sql_command
Definition: my_sqlcommand.h:46
void error(const char *format,...)
static bool ignore
Definition: mysqlimport.cc:70
static int record
Definition: mysqltest.cc:195
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
bool is_partition(const std::string &dict_name)
Check if it is a table partition.
Definition: dict0dd.cc:7452
Definition: aligned_atomic.h:44
const char * table_name
Definition: rules_table_service.cc:56
const char * db_name
Definition: rules_table_service.cc:55
mode
Definition: file_handle.h:61
page_cur_mode_t
Definition: page0types.h:176
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Parallel read adapter interface.
Parallel read histogram interface.
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
enum_alter_inplace_result
Return values for check_if_supported_inplace_alter().
Definition: handler.h:200
enum_tx_isolation
Definition: handler.h:3186
row_type
Definition: handler.h:684
enum_sampling_method
Definition: handler.h:715
static bool commit(THD *thd)
Commit the current statement and transaction.
Definition: sql_cmd_srs.cc:152
case opt name
Definition: sslopt-case.h:29
TempTable public handler API declaration.
Callbacks for collecting time statistics.
Definition: bulk_data_service.h:324
Definition: ft_global.h:72
Definition: handler.h:3804
Definition: handler.h:3791
Struct to hold information about the table that should be created.
Definition: handler.h:3202
const char * tablespace
Definition: handler.h:3208
InnoDB table share.
Definition: ha_innodb.h:65
const char * table_name
InnoDB table name.
Definition: ha_innodb.h:66
innodb_idx_translate_t idx_trans_tbl
index translation table between MySQL and InnoDB
Definition: ha_innodb.h:73
void * table_name_hash
hash table chain node
Definition: ha_innodb.h:71
uint use_count
reference count, incremented in get_share() and decremented in free_share()
Definition: ha_innodb.h:67
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: handler.h:3812
This structure is shared between different table objects.
Definition: table.h:701
Definition: thr_lock.h:124
Definition: ft_global.h:57
Definition: ft_global.h:48
Data structure for newly added virtual column in a table.
Definition: dict0mem.h:835
Data structure for an index.
Definition: dict0mem.h:1046
Data structure for a stored column in a table.
Definition: dict0mem.h:847
static const char * s_file_per_table_name
The hard-coded tablespace name innodb_file_per_table.
Definition: dict0dict.h:1151
static const char * s_sys_space_name
The name of the hard-coded system tablespace.
Definition: dict0dict.h:1142
static const char * s_temp_space_name
The name of the predefined temporary tablespace.
Definition: dict0dict.h:1145
Data structure for a database table.
Definition: dict0mem.h:1909
Data structure for a virtual column in a table.
Definition: dict0mem.h:815
Structure defines template related to virtual columns and their base columns.
Definition: dict0mem.h:1846
Query result.
Definition: fts0fts.h:314
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2734
Definition: ha_innodb.h:53
dict_index_t ** index_mapping
index pointer array directly maps to index in InnoDB from MySQL array index
Definition: ha_innodb.h:59
ulint array_size
array size of index_mapping
Definition: ha_innodb.h:57
ulint index_count
number of valid index entries in the index_mapping array
Definition: ha_innodb.h:54
Definition: my_base.h:1125
Structure Returned by ha_innobase::ft_init_ext()
Definition: ha_innodb.h:732
struct _ft_vft_ext * could_you
Definition: ha_innodb.h:734
row_prebuilt_t * ft_prebuilt
Definition: ha_innodb.h:735
fts_result_t * ft_result
Definition: ha_innodb.h:736
struct _ft_vft * please
Definition: ha_innodb.h:733
A struct for (sometimes lazily) prebuilt structures in an Innobase table handle used within MySQL; th...
Definition: row0mysql.h:515
Definition: trx0trx.h:684
bool is_registered
Definition: trx0trx.h:876
isolation_level_t
Definition: trx0trx.h:685
thr_lock_type
Definition: thr_lock.h:51
ulong srv_page_size
Definition: srv0srv.cc:399
unsigned long int ulint
Definition: univ.i:406
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:105