1#ifndef HANDLER_INCLUDED
2#define HANDLER_INCLUDED
149 uint key_length,
ulonglong *engine_data);
152 const char *
file,
size_t file_len,
153 const char *
status,
size_t status_len);
183#define HA_ADMIN_ALREADY_DONE 1
185#define HA_ADMIN_NOT_IMPLEMENTED -1
186#define HA_ADMIN_FAILED -2
187#define HA_ADMIN_CORRUPT -3
188#define HA_ADMIN_INTERNAL_ERROR -4
189#define HA_ADMIN_INVALID -5
190#define HA_ADMIN_REJECT -6
191#define HA_ADMIN_TRY_ALTER -7
192#define HA_ADMIN_WRONG_CHECKSUM -8
193#define HA_ADMIN_NOT_BASE_TABLE -9
194#define HA_ADMIN_NEEDS_UPGRADE -10
195#define HA_ADMIN_NEEDS_ALTER -11
196#define HA_ADMIN_NEEDS_CHECK -12
197#define HA_ADMIN_STATS_UPD_ERR -13
199#define HA_ADMIN_NEEDS_DUMP_UPGRADE -14
225#define HA_NO_TRANSACTIONS (1 << 0)
226#define HA_PARTIAL_COLUMN_READ (1 << 1)
233#define HA_TABLE_SCAN_ON_INDEX (1 << 2)
236#define HA_UNUSED3 (1 << 3)
243#define HA_CAN_GEOMETRY (1 << 4)
249#define HA_FAST_KEY_READ (1 << 5)
254#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
260#define HA_NULL_IN_KEY (1 << 7)
266#define HA_DUPLICATE_POS (1 << 8)
267#define HA_NO_BLOBS (1 << 9)
272#define HA_CAN_INDEX_BLOBS (1 << 10)
277#define HA_AUTO_PART_KEY (1 << 11)
282#define HA_REQUIRE_PRIMARY_KEY (1 << 12)
287#define HA_STATS_RECORDS_IS_EXACT (1 << 13)
289#define HA_UNUSED14 (1 << 14)
296#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
304#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
305#define HA_CAN_RTREEKEYS (1 << 17)
312#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
316#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
320#define HA_CAN_FULLTEXT (1 << 21)
325#define HA_CAN_SQL_HANDLER (1 << 22)
329#define HA_NO_AUTO_INCREMENT (1 << 23)
333#define HA_HAS_CHECKSUM (1 << 24)
339#define HA_FILE_BASED (1 << 26)
340#define HA_NO_VARCHAR (1 << 27)
344#define HA_CAN_BIT_FIELD (1 << 28)
345#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
346#define HA_NO_COPY_ON_ALTER (1LL << 31)
347#define HA_COUNT_ROWS_INSTANT (1LL << 32)
349#define HA_HAS_OWN_BINLOGGING (1LL << 33)
354#define HA_BINLOG_ROW_CAPABLE (1LL << 34)
355#define HA_BINLOG_STMT_CAPABLE (1LL << 35)
378#define HA_DUPLICATE_KEY_NOT_IN_ORDER (1LL << 36)
384#define HA_CAN_REPAIR (1LL << 37)
390#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
426#define HA_READ_BEFORE_WRITE_REMOVAL (1LL << 38)
431#define HA_CAN_FULLTEXT_EXT (1LL << 39)
439#define HA_READ_OUT_OF_SYNC (1LL << 40)
445#define HA_CAN_EXPORT (1LL << 41)
451#define HA_BLOCK_CONST_TABLE (1LL << 42)
456#define HA_CAN_FULLTEXT_HINTS (1LL << 43)
464#define HA_NO_READ_LOCAL_LOCK (1LL << 44)
477#define HA_ATTACHABLE_TRX_COMPATIBLE (1LL << 45)
482#define HA_GENERATED_COLUMNS (1LL << 46)
487#define HA_CAN_INDEX_VIRTUAL_GENERATED_COLUMN (1LL << 47)
492#define HA_DESCENDING_INDEX (1LL << 48)
497#define HA_BLOB_PARTIAL_UPDATE (1LL << 49)
504#define HA_SUPPORTS_GEOGRAPHIC_GEOMETRY_COLUMN (1LL << 50)
509#define HA_SUPPORTS_DEFAULT_EXPRESSION (1LL << 51)
514#define HA_UPDATE_NOT_SUPPORTED (1LL << 52)
519#define HA_DELETE_NOT_SUPPORTED (1LL << 53)
525#define HA_NO_INDEX_ACCESS (1LL << 54)
530#define HA_MULTI_VALUED_KEY_SUPPORT (1LL << 55)
541#define HA_READ_NEXT 1
545#define HA_READ_PREV 2
557#define HA_READ_ORDER 4
564#define HA_READ_RANGE 8
569#define HA_ONLY_WHOLE_INDEX 16
576#define HA_TABLE_SCAN_ON_NULL 32
586#define HA_KEYREAD_ONLY 64
591#define HA_KEY_SCAN_NOT_ROR 128
592#define HA_DO_INDEX_COND_PUSHDOWN 256
595#define HA_KEY_SWITCH_NONUNIQ 0
596#define HA_KEY_SWITCH_ALL 1
597#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
598#define HA_KEY_SWITCH_ALL_SAVE 3
605#define HA_SLOT_UNDEF ((uint)-1)
612#define HA_OPEN_KEYFILE 1
613#define HA_OPEN_RNDFILE 2
614#define HA_GET_INDEX 4
616#define HA_READ_ONLY 16
618#define HA_TRY_READ_ONLY 32
619#define HA_WAIT_IF_LOCKED 64
620#define HA_ABORT_IF_LOCKED 128
621#define HA_BLOCK_LOCK 256
622#define HA_OPEN_TEMPORARY 512
625#define HA_KEY_NULL_LENGTH 1
626#define HA_KEY_BLOB_LENGTH 2
628#define HA_LEX_CREATE_TMP_TABLE 1
629#define HA_LEX_CREATE_IF_NOT_EXISTS 2
630#define HA_LEX_CREATE_TABLE_LIKE 4
631#define HA_LEX_CREATE_INTERNAL_TMP_TABLE 8
632#define HA_LEX_CREATE_EXTERNAL_TABLE 16
633#define HA_MAX_REC_LENGTH 65535U
726#define HA_CREATE_USED_AUTO (1L << 0)
727#define HA_CREATE_USED_RAID (1L << 1)
728#define HA_CREATE_USED_UNION (1L << 2)
729#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
730#define HA_CREATE_USED_MIN_ROWS (1L << 4)
731#define HA_CREATE_USED_MAX_ROWS (1L << 5)
732#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
733#define HA_CREATE_USED_PACK_KEYS (1L << 7)
734#define HA_CREATE_USED_CHARSET (1L << 8)
735#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
736#define HA_CREATE_USED_DATADIR (1L << 10)
737#define HA_CREATE_USED_INDEXDIR (1L << 11)
738#define HA_CREATE_USED_ENGINE (1L << 12)
739#define HA_CREATE_USED_CHECKSUM (1L << 13)
740#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
741#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
742#define HA_CREATE_USED_COMMENT (1L << 16)
743#define HA_CREATE_USED_PASSWORD (1L << 17)
744#define HA_CREATE_USED_CONNECTION (1L << 18)
745#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
747#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
749#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
755#define HA_CREATE_USED_STATS_PERSISTENT (1L << 22)
762#define HA_CREATE_USED_STATS_AUTO_RECALC (1L << 23)
769#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1L << 24)
774#define HA_CREATE_USED_TABLESPACE (1L << 25)
777#define HA_CREATE_USED_COMPRESS (1L << 26)
780#define HA_CREATE_USED_ENCRYPT (1L << 27)
787#define HA_CREATE_USED_DEFAULT_COLLATE (1L << 28)
790#define HA_CREATE_USED_SECONDARY_ENGINE (1L << 29)
797#define HA_CREATE_USED_DEFAULT_ENCRYPTION (1L << 30)
850#define MAXGTRIDSIZE 64
851#define MAXBQUALSIZE 64
853#define COMPATIBLE_DATA_YES 0
854#define COMPATIBLE_DATA_NO 1
860#define UNDEF_NODEGROUP 65535
939 const char *datafile,
const char *undofile,
1125 if (lenp !=
nullptr) {
1276 std::unordered_set<my_xid, std::hash<my_xid>, std::equal_to<my_xid>,
1285 using pair = std::pair<const XID, enum_ha_recover_xa_state>;
1287 using list = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1289 using iterator = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1292 std::unique_ptr<MEM_ROOT>, std::unique_ptr<Xa_state_list::allocator>,
1293 std::unique_ptr<Xa_state_list::list>, std::unique_ptr<Xa_state_list>>;
1518 const char *schema_name);
1521 const char *schema_name);
1563 const char *tablespace_name);
1592typedef const char *(*get_tablespace_filename_ext_t)();
1691 const char *
query, uint query_length,
1698 const char *
name,
uchar **frmblob,
size_t *frmlen);
1701 const char *
path,
const char *wild,
bool dir,
1705 const char *
db,
const char *
name);
1743 bool is_sql_layer_system_table);
1815 const void *sdi,
uint64 sdi_len);
1893 void **ptr_trx_arg);
2089 const char *old_db_name,
2090 const char *old_table_name,
2091 const char *new_db_name,
2092 const char *new_table_name);
2164 const char *column_name,
double rows_in_table);
2187 uint index_ordinal_position, uint column_ordinal_position,
2206 const char *tablespace_name,
const char *
file_name,
2249 uint loc_len, uint task_id,
int in_err,
2261 uint loc_len, uint task_id,
int in_err);
2273 const uchar *&loc, uint &loc_len,
2275 const char *data_dir);
2287 uint loc_len, uint task_id,
int in_err,
2299 uint loc_len, uint task_id,
int in_err);
2423 double optimizer_cost,
2424 bool *use_best_so_far,
2426 double *secondary_engine_cost);
2544 std::string_view (*)(
const THD *thd);
2556 std::string_view (*)(
THD *thd);
2570 bool (*)(
const THD *thd, std::string_view reason);
2611 const AccessPath *access_path,
int current_subgraph_pairs,
2612 int current_subgraph_pairs_limit,
bool is_root_access_path,
2613 std::string *trace);
2640template <
typename... Args>
2643 return (uint64_t{1} <<
static_cast<int>(flag1)) |
2702 std::string_view view_def);
2799 void *cbk_ctx, uint64_t *start_id,
2823 uint64_t *num_pages);
2829 void (*)(std::vector<std::pair<uint64_t, bool>> &
status);
3143#define HTON_NO_FLAGS 0
3144#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
3145#define HTON_ALTER_NOT_SUPPORTED (1 << 1)
3146#define HTON_CAN_RECREATE (1 << 2)
3147#define HTON_HIDDEN (1 << 3)
3152#define HTON_NOT_USER_SELECTABLE (1 << 5)
3153#define HTON_TEMPORARY_NOT_SUPPORTED \
3155#define HTON_SUPPORT_LOG_TABLES (1 << 7)
3156#define HTON_NO_PARTITION (1 << 8)
3171#define HTON_NO_BINLOG_ROW_OPT (1 << 9)
3181#define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10)
3185#define HTON_SUPPORTS_FOREIGN_KEYS (1 << 11)
3193#define HTON_SUPPORTS_ATOMIC_DDL (1 << 12)
3196#define HTON_SUPPORTS_PACKED_KEYS (1 << 13)
3199#define HTON_IS_SECONDARY_ENGINE (1 << 14)
3202#define HTON_SUPPORTS_SECONDARY_ENGINE (1 << 15)
3205#define HTON_SUPPORTS_TABLE_ENCRYPTION (1 << 16)
3212constexpr const decltype(
3218#define HTON_SECONDARY_ENGINE_SUPPORTS_DDL (1 << 19)
3221#define HTON_NO_TRIGGER_SUPPORT (1 << 20)
3229#define HTON_SUPPORTS_EXTERNAL_SOURCE (1 << 21)
3513 [[maybe_unused]]) {}
3884 Alter_info *alter_info_arg,
bool error_if_not_empty_arg,
3885 KEY *key_info_arg, uint key_count_arg,
3923 const char *try_instead);
3931 (
"index renamed: '%s' to '%s'", old_key->
name, new_key->
name));
3939 DBUG_PRINT(
"info", (
"index had visibility altered: %i to %i",
4124 return other > *
this ? true :
false;
4160#define HA_MRR_SINGLE_POINT 1
4161#define HA_MRR_FIXED_KEY 2
4167#define HA_MRR_NO_ASSOCIATION 4
4177#define HA_MRR_SORTED 8
4180#define HA_MRR_INDEX_ONLY 16
4186#define HA_MRR_LIMITS 32
4194#define HA_MRR_USE_DEFAULT_IMPL 64
4201#define HA_MRR_NO_NULL_ENDPOINTS 128
4209#define HA_MRR_SUPPORT_SORTED 256
4289#define make_keypart_map(N) (((key_part_map)2 << (N)) - 1)
4294#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
5010 DBUG_PRINT(
"info", (
"handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
5011 F_UNLCK, F_RDLCK, F_WRLCK));
5015 assert(
m_psi ==
nullptr);
5128 uint *dup_key_found);
5148 bool error_if_not_loaded);
5166 size_t *num_threads [[maybe_unused]],
5167 bool use_reserved_threads [[maybe_unused]],
5168 size_t max_desired_threads [[maybe_unused]]) {
5192 void *cookie, ulong ncols, ulong row_len,
const ulong *col_offsets,
5193 const ulong *null_byte_offsets,
const ulong *null_bitmasks)>;
5207 using Load_cbk = std::function<bool(
void *cookie, uint nrows,
void *rowdata,
5208 uint64_t partition_id)>;
5231 void **thread_ctxs [[maybe_unused]],
5258 [[maybe_unused]])
const {
5270 size_t thread_idx [[maybe_unused]],
5272 [[maybe_unused]])
const {
5289 void *load_ctx [[maybe_unused]],
5290 const std::vector<Bulk_load::Source_table_data> &source_table_data
5291 [[maybe_unused]])
const {
5301 size_t &
max [[maybe_unused]])
const {
5323 size_t keynr [[maybe_unused]],
5324 size_t data_size [[maybe_unused]],
5325 size_t memory [[maybe_unused]],
5326 size_t num_threads [[maybe_unused]]) {
5338 void *load_ctx [[maybe_unused]],
5339 size_t thread_idx [[maybe_unused]],
5354 void *load_ctx [[maybe_unused]],
5355 size_t thread_idx [[maybe_unused]],
5357 unsigned char *blobref [[maybe_unused]]) {
5370 void *load_ctx [[maybe_unused]],
5371 size_t thread_idx [[maybe_unused]],
5373 unsigned char *blobref [[maybe_unused]],
5374 const unsigned char *data [[maybe_unused]],
5375 size_t data_len [[maybe_unused]]) {
5386 void *load_ctx [[maybe_unused]],
5387 size_t thread_idx [[maybe_unused]],
5389 unsigned char *blobref [[maybe_unused]]) {
5400 void *load_ctx [[maybe_unused]],
5401 bool is_error [[maybe_unused]]) {
5447 uint child_table_name_len,
5448 char *child_key_name,
5449 uint child_key_name_len);
5650 const bool tablesample);
5688 uint keyno,
RANGE_SEQ_IF *seq,
void *seq_init_param, uint n_ranges,
5691 uint *bufsz, uint *
flags,
5694 uint n_ranges, uint
mode,
5954 const key_range *end_key,
bool eq_range_arg,
6099 return extra(operation);
6222 DBUG_PRINT(
"info", (
"auto_increment: next value %lu", (ulong)
id));
6252 [[maybe_unused]]) {}
6276 virtual ulong
index_flags(uint idx, uint part,
bool all_parts)
const = 0;
6299 [[maybe_unused]])
const {
6502 uint table_changes [[maybe_unused]]) {
6751 TABLE *altered_table [[maybe_unused]],
6753 const dd::Table *old_table_def [[maybe_unused]],
6754 dd::Table *new_table_def [[maybe_unused]]) {
6792 dd::Table *new_table_def [[maybe_unused]]) {
6848 bool commit [[maybe_unused]],
6854 ha_alter_info->group_commit_ctx =
nullptr;
6876 [[maybe_unused]]) {}
6920 virtual int rename_table(
const char *from,
const char *to,
7054 int lock_type [[maybe_unused]]) {
7097 const char *dbname [[maybe_unused]],
7112 virtual int sample_init(
void *&scan_ctx,
double sampling_percentage,
7115 const bool tablesample);
7139 bool *skip_metadata_update [[maybe_unused]]) {
7160 bool error_if_not_loaded [[maybe_unused]]) {
7170 uint key_len [[maybe_unused]],
7176 uint key_len [[maybe_unused]]) {
7200 uint *dup_key_found [[maybe_unused]]) {
7346 bool reset [[maybe_unused]]) {
7371 const KEY *key_info [[maybe_unused]], uint key_count [[maybe_unused]],
7372 dd::Table *table_obj [[maybe_unused]]) {
7398 const char **mv_data_ptr,
7429 const char **mv_data_ptr, ulong *mv_length,
7430 bool include_stored_gcols);
7572 assert(
h2 ==
nullptr);
7610 assert(table_arg !=
nullptr);
7636 uint n_ranges, uint *bufsz, uint *
flags,
7696 return db_type ==
nullptr ? false : (db_type->
flags &
flag);
7772 const char *db,
const char *alias,
7944 size_t query_length,
const char *db,
7958 const char *org_table_name);
7960 const char *org_table_name);
7978 const char *old_table_name,
const char *new_db_name,
7979 const char *new_table_name);
app_data_ptr new_data(u_int n, char *val, cons_type consensus)
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:247
Services for bulk data conversion and load to SE.
Definition: acl_change_notification.h:32
const std::string db
Definition: acl_change_notification.h:51
Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.
Definition: sql_alter.h:210
Class describing changes to be done by ALTER TABLE.
Definition: handler.h:3525
static const HA_ALTER_FLAGS COALESCE_PARTITION
Definition: handler.h:3642
Alter_info * alter_info
Alter options, fields and keys for the new version of table.
Definition: handler.h:3745
static const HA_ALTER_FLAGS CHANGE_INDEX_OPTION
Change index option in a way which is likely not to require index recreation.
Definition: handler.h:3684
uint key_count
Size of key_info_buffer array.
Definition: handler.h:3781
static const HA_ALTER_FLAGS ALTER_VIRTUAL_COLUMN_TYPE
Definition: handler.h:3584
static const HA_ALTER_FLAGS DROP_PARTITION
Definition: handler.h:3636
static const HA_ALTER_FLAGS ADD_VIRTUAL_COLUMN
Definition: handler.h:3565
const char * unsupported_reason
Can be set by handler to describe why a given operation cannot be done in-place (HA_ALTER_INPLACE_NOT...
Definition: handler.h:3881
KEY * key_info_buffer
Array of KEYs for new version of table - including KEYs to be added.
Definition: handler.h:3778
static const HA_ALTER_FLAGS ADD_FOREIGN_KEY
Definition: handler.h:3615
static const HA_ALTER_FLAGS DROP_COLUMN
Definition: handler.h:3577
static const HA_ALTER_FLAGS ALTER_COLUMN_INDEX_LENGTH
Change in index length such that it does not require index rebuild.
Definition: handler.h:3694
static const HA_ALTER_FLAGS ADD_STORED_GENERATED_COLUMN
Definition: handler.h:3569
static const HA_ALTER_FLAGS ALTER_TABLE_REORG
Definition: handler.h:3648
static const HA_ALTER_FLAGS VALIDATE_VIRTUAL_COLUMN
Definition: handler.h:3677
static const HA_ALTER_FLAGS ADD_SPATIAL_INDEX
Definition: handler.h:3671
static const HA_ALTER_FLAGS DROP_CHECK_CONSTRAINT
Definition: handler.h:3712
static const HA_ALTER_FLAGS ALTER_STORED_GCOL_EXPR
Definition: handler.h:3612
uint virtual_column_add_count
Number of virtual columns to be added.
Definition: handler.h:3819
static const HA_ALTER_FLAGS RECREATE_TABLE
Recreate the table for ALTER TABLE FORCE, ALTER TABLE ENGINE and OPTIMIZE TABLE operations.
Definition: handler.h:3668
static const HA_ALTER_FLAGS STORED_GCOL_REEVAL
Change to one of columns on which stored generated column depends, so its values require re-evaluatio...
Definition: handler.h:3706
static const HA_ALTER_FLAGS ADD_PARTITION
Definition: handler.h:3633
static const HA_ALTER_FLAGS ADD_STORED_BASE_COLUMN
Definition: handler.h:3567
static const HA_ALTER_FLAGS ADD_PK_INDEX
Definition: handler.h:3557
uint index_drop_count
Size of index_drop_buffer array.
Definition: handler.h:3784
ulonglong HA_ALTER_FLAGS
Bits to show in detail what operations the storage engine is to execute.
Definition: handler.h:3542
static const HA_ALTER_FLAGS ALTER_COLUMN_STORAGE_TYPE
Definition: handler.h:3627
static const HA_ALTER_FLAGS ALTER_COLUMN_NAME
Definition: handler.h:3581
static const HA_ALTER_FLAGS ALTER_COLUMN_COLUMN_FORMAT
Definition: handler.h:3630
static const HA_ALTER_FLAGS ALTER_COLUMN_MASKING
Definition: handler.h:3721
static const HA_ALTER_FLAGS ADD_COLUMN
Definition: handler.h:3571
static const HA_ALTER_FLAGS ALTER_REBUILD_PARTITION
Definition: handler.h:3687
static const HA_ALTER_FLAGS ALTER_INDEX_COMMENT
Definition: handler.h:3674
KEY_PAIR * index_rename_buffer
Array of KEY_PAIR objects describing indexes being renamed.
Definition: handler.h:3815
uint index_altered_visibility_count
Size of index_rename_buffer array.
Definition: handler.h:3805
void report_unsupported_error(const char *not_supported, const char *try_instead)
Used after check_if_supported_inplace_alter() to report error if the result does not match the LOCK/A...
Definition: handler.cc:5179
bool error_if_not_empty
Indicates whether operation should fail if table is non-empty.
Definition: handler.h:3761
static const HA_ALTER_FLAGS ADD_CHECK_CONSTRAINT
Definition: handler.h:3709
static const HA_ALTER_FLAGS ALTER_RENAME
Definition: handler.h:3624
void add_renamed_key(KEY *old_key, KEY *new_key)
Add old and new version of key to array of indexes to be renamed.
Definition: handler.h:3926
static const HA_ALTER_FLAGS SUSPEND_CHECK_CONSTRAINT
Definition: handler.h:3715
static const HA_ALTER_FLAGS ALTER_REMOVE_PARTITIONING
Definition: handler.h:3651
static const HA_ALTER_FLAGS ALTER_COLUMN_EQUAL_PACK_LENGTH
Change column datatype in such way that new type has compatible packed representation with old type,...
Definition: handler.h:3593
uint index_add_count
Size of index_add_buffer array.
Definition: handler.h:3793
static const HA_ALTER_FLAGS REORGANIZE_PARTITION
Definition: handler.h:3645
inplace_alter_handler_ctx * handler_ctx
Context information to allow handlers to keep context between in-place alter API calls.
Definition: handler.h:3830
static const HA_ALTER_FLAGS ALTER_VIRTUAL_GCOL_EXPR
Definition: handler.h:3611
static const HA_ALTER_FLAGS ADD_INDEX
Definition: handler.h:3545
static const HA_ALTER_FLAGS DROP_FOREIGN_KEY
Definition: handler.h:3618
uint index_rename_count
Size of index_rename_buffer array.
Definition: handler.h:3802
static const HA_ALTER_FLAGS ADD_UNIQUE_INDEX
Definition: handler.h:3551
HA_CREATE_INFO * create_info
Create options (like MAX_ROWS) for the new version of table.
Definition: handler.h:3732
uint handler_trivial_ctx
Can be set by handler along with handler_ctx.
Definition: handler.h:3867
KEY_PAIR * index_altered_visibility_buffer
Definition: handler.h:3816
static const HA_ALTER_FLAGS DROP_INDEX
Definition: handler.h:3548
static const HA_ALTER_FLAGS ALTER_COLUMN_NOT_NULLABLE
Definition: handler.h:3605
static const HA_ALTER_FLAGS DROP_UNIQUE_INDEX
Definition: handler.h:3554
static const HA_ALTER_FLAGS ALTER_PARTITION
Definition: handler.h:3639
static const HA_ALTER_FLAGS ALTER_COLUMN_NULLABLE
Definition: handler.h:3602
partition_info * modified_part_info
Partition_info taking into account the partition changes to be performed.
Definition: handler.h:3856
HA_ALTER_FLAGS handler_flags
Flags describing in detail which operations the storage engine is to execute.
Definition: handler.h:3848
Alter_inplace_info(HA_CREATE_INFO *create_info_arg, Alter_info *alter_info_arg, bool error_if_not_empty_arg, KEY *key_info_arg, uint key_count_arg, partition_info *modified_part_info_arg)
Definition: handler.h:3883
~Alter_inplace_info()
Definition: handler.h:3909
static const HA_ALTER_FLAGS VIRTUAL_GCOL_REEVAL
Change to one of columns on which virtual generated column depends, so its values require re-evaluati...
Definition: handler.h:3700
void add_added_key(KEY *new_key)
Add key to array of indexes to be added.
Definition: handler.h:3960
void add_altered_index_visibility(KEY *old_key, KEY *new_key)
Definition: handler.h:3934
static const HA_ALTER_FLAGS ALTER_VIRTUAL_COLUMN_ORDER
A virtual column has changed its position.
Definition: handler.h:3596
static const HA_ALTER_FLAGS RENAME_INDEX
Rename index.
Definition: handler.h:3662
uint virtual_column_drop_count
number of virtual columns to be dropped.
Definition: handler.h:3822
void add_modified_key(KEY *old_key, KEY *new_key)
Add old and new version of modified key to arrays of indexes to be dropped and added (correspondingly...
Definition: handler.h:3947
static const HA_ALTER_FLAGS DROP_PK_INDEX
Definition: handler.h:3560
static const HA_ALTER_FLAGS ALTER_STORED_COLUMN_ORDER
A stored column has changed its position (disregarding virtual columns)
Definition: handler.h:3599
bool online
true for online operation (LOCK=NONE)
Definition: handler.h:3859
KEY ** index_drop_buffer
Array of pointers to KEYs to be dropped belonging to the TABLE instance for the old version of the ta...
Definition: handler.h:3790
uint * index_add_buffer
Array of indexes into key_info_buffer for KEYs to be added, sorted in increasing order.
Definition: handler.h:3799
void add_dropped_key(KEY *old_key)
Drop key to array of indexes to be dropped.
Definition: handler.h:3954
static const HA_ALTER_FLAGS CHANGE_CREATE_OPTION
Definition: handler.h:3621
static const HA_ALTER_FLAGS DROP_VIRTUAL_COLUMN
Definition: handler.h:3575
static const HA_ALTER_FLAGS ALTER_COLUMN_VISIBILITY
Definition: handler.h:3718
static const HA_ALTER_FLAGS ALTER_STORED_COLUMN_TYPE
Definition: handler.h:3585
inplace_alter_handler_ctx ** group_commit_ctx
If the table uses several handlers, like ha_partition uses one handler per partition,...
Definition: handler.h:3842
static const HA_ALTER_FLAGS ALTER_COLUMN_DEFAULT
Definition: handler.h:3608
static const HA_ALTER_FLAGS DROP_STORED_COLUMN
Definition: handler.h:3576
static const HA_ALTER_FLAGS ALTER_ALL_PARTITION
Definition: handler.h:3654
Used to store optimizer cost estimates.
Definition: handler.h:4040
Cost_estimate & operator+=(const Cost_estimate &other)
Definition: handler.h:4089
Cost_estimate operator-(const Cost_estimate &other)
Definition: handler.h:4107
void add_import(double add_import_cost)
Add to import cost.
Definition: handler.h:4140
void reset()
Reset all costs to zero.
Definition: handler.h:4072
void set_max_cost()
Set current cost to the maximal double.
Definition: handler.h:4074
Cost_estimate()
Definition: handler.h:4048
void add_cpu(double add_cpu_cost)
Add to CPU cost.
Definition: handler.h:4134
double mem_cost
memory used (bytes)
Definition: handler.h:4045
double io_cost
cost of I/O operations
Definition: handler.h:4042
bool is_max_cost() const
Whether or not the total cost is the maximal double.
Definition: handler.h:4070
void add_mem(double add_mem_cost)
Add to memory cost.
Definition: handler.h:4146
bool operator<(const Cost_estimate &other) const
Definition: handler.h:4123
double get_cpu_cost() const
Definition: handler.h:4053
double get_mem_cost() const
Definition: handler.h:4055
double total_cost() const
Returns sum of time-consuming costs, i.e., not counting memory cost.
Definition: handler.h:4051
double get_io_cost() const
Definition: handler.h:4052
void add_io(double add_io_cost)
Add to IO cost.
Definition: handler.h:4128
double import_cost
cost of remote operations
Definition: handler.h:4044
double cpu_cost
cost of CPU operations
Definition: handler.h:4043
double get_import_cost() const
Definition: handler.h:4054
void multiply(double m)
Multiply io, cpu and import costs by parameter.
Definition: handler.h:4080
bool is_zero() const
Whether or not all costs in the object are zero.
Definition: handler.h:4062
bool operator>(const Cost_estimate &other) const
Definition: handler.h:4119
Cost_estimate operator+(const Cost_estimate &other)
Definition: handler.h:4100
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:51
Definition: discrete_interval.h:41
Definition: handler.h:7561
DsMrr_impl(handler *owner)
Definition: handler.h:7563
bool get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags, uint *buffer_size, Cost_estimate *cost)
Get cost of DS-MRR scan.
Definition: handler.cc:7249
void reset()
Resets the DS-MRR object to the state it had after being initialized.
Definition: handler.cc:6919
ha_rows dsmrr_info(uint keyno, uint n_ranges, uint keys, uint *bufsz, uint *flags, Cost_estimate *cost)
Definition: handler.cc:7061
ha_rows dsmrr_info_const(uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, uint *flags, Cost_estimate *cost)
Definition: handler.cc:7090
void dsmrr_close()
Definition: handler.cc:6908
uchar * rowids_buf_end
Definition: handler.h:7590
uchar * rowids_buf_cur
Definition: handler.h:7588
int dsmrr_fill_buffer()
DS-MRR: Fill the buffer with rowids and sort it by rowid.
Definition: handler.cc:6948
uchar * rowids_buf
Definition: handler.h:7587
handler * h2
Definition: handler.h:7584
handler *const h
Definition: handler.h:7580
~DsMrr_impl()
Definition: handler.h:7565
bool use_default_impl
Definition: handler.h:7597
void init(TABLE *table_arg)
Initialize the DsMrr_impl object.
Definition: handler.h:7609
int dsmrr_init(RANGE_SEQ_IF *seq_funcs, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf)
DS-MRR: Initialize and start MRR scan.
Definition: handler.cc:6731
bool choose_mrr_impl(uint keyno, ha_rows rows, uint *flags, uint *bufsz, Cost_estimate *cost)
DS-MRR Internals: Choose between Default MRR implementation and DS-MRR.
Definition: handler.cc:7152
bool dsmrr_eof
Definition: handler.h:7592
bool is_mrr_assoc
Definition: handler.h:7595
uchar * rowids_buf_last
Definition: handler.h:7589
TABLE * table
Definition: handler.h:7581
int dsmrr_next(char **range_info)
Definition: handler.cc:7015
Wrapper for struct ft_hints.
Definition: handler.h:4307
uint get_flags() const
Get Ft_hints flags.
Definition: handler.h:4370
void set_hint_flag(uint ft_flag)
Set Ft_hints flag.
Definition: handler.h:4335
double get_op_value() const
Get Ft_hints operation value.
Definition: handler.h:4356
struct ft_hints * get_hints()
Get ft_hints struct.
Definition: handler.h:4377
Ft_hints(uint ft_flags)
Definition: handler.h:4312
ha_rows get_limit() const
Get Ft_hints limit.
Definition: handler.h:4349
enum ft_operation get_op_type() const
Get Ft_hints operation type.
Definition: handler.h:4363
void set_hint_limit(ha_rows ft_limit)
Set Ft_hints limit.
Definition: handler.h:4342
void set_hint_op(enum ft_operation type, double value)
Set comparison operation type and and value for master MATCH function.
Definition: handler.h:4325
struct ft_hints hints
Definition: handler.h:4309
Definition: handler.h:1043
const char * get_source_name()
Get SE source file name.
Definition: handler.h:1134
void set_dest_name(const char *name)
Set SE destination file name.
Definition: handler.h:1146
virtual int file_cbk(Ha_clone_file from_file, uint len)=0
Callback providing data from current position of a file descriptor of specific length.
uint m_desc_len
SE's Serialized descriptor length.
Definition: handler.h:1208
void set_hton(handlerton *hton)
Set current storage engine handlerton.
Definition: handler.h:1088
handlerton * get_hton()
Get current storage engine handlerton.
Definition: handler.h:1092
virtual int buffer_cbk(uchar *from_buffer, uint len)=0
Callback providing data in buffer of specific length.
Ha_clone_cbk()
Constructor to initialize members.
Definition: handler.h:1046
const int HA_CLONE_FILE_CACHE
Data file is opened for read/write with OS buffer cache.
Definition: handler.h:1226
void mark_state_change(uint64_t estimate)
Set state information and notify state change.
Definition: handler.h:1183
bool is_os_buffer_cache() const
Check if the file descriptor is opened for read/write with OS buffer cache.
Definition: handler.h:1167
void set_os_buffer_cache()
Mark that the file descriptor is opened for read/write with OS buffer cache.
Definition: handler.h:1161
const int HA_CLONE_STATE_CHANGE
State change notification by SE.
Definition: handler.h:1235
const char * m_dest_name
Current destination file name.
Definition: handler.h:1214
int m_flag
Flag storing data related options.
Definition: handler.h:1220
void set_source_name(const char *name)
Set SE source file name.
Definition: handler.h:1138
bool is_zero_copy() const
Check if zero copy optimization is suggested.
Definition: handler.h:1173
const char * m_src_name
Current source file name.
Definition: handler.h:1211
bool is_state_change(uint64_t &estimate)
Check if SE notified state change.
Definition: handler.h:1189
uint m_loc_idx
SE index in caller's locator array.
Definition: handler.h:1199
const uchar * get_data_desc(uint *lenp)
Get data descriptor.
Definition: handler.h:1124
uint64_t m_state_estimate
Estimated bytes to be transferred.
Definition: handler.h:1217
const uchar * m_data_desc
SE's Serialized data descriptor.
Definition: handler.h:1205
const char * get_dest_name()
Get SE destination file name.
Definition: handler.h:1142
bool is_secure() const
Check if data needs secure transfer.
Definition: handler.h:1179
void set_zero_copy()
Mark that the file can be transferred with zero copy.
Definition: handler.h:1170
virtual ~Ha_clone_cbk()=default
virtual destructor.
const int HA_CLONE_SECURE
Data needs to be transferred securely over SSL connection.
Definition: handler.h:1232
virtual int apply_buffer_cbk(uchar *&to_buffer, uint &len)=0
Callback to get data in buffer.
uint m_client_buff_size
Caller's transfer buffer size.
Definition: handler.h:1202
virtual int apply_file_cbk(Ha_clone_file to_file)=0
Callback providing a file descriptor to write data starting from current position.
void set_ack()
Mark that ACK is needed for the data transfer before returning from callback.
Definition: handler.h:1153
bool is_ack_needed() const
Check if ACK is needed for the data transfer.
Definition: handler.h:1157
void set_client_buffer_size(uint size)
Set caller's transfer buffer size.
Definition: handler.h:1097
void set_secure()
Mark that data needs secure transfer.
Definition: handler.h:1176
const int HA_CLONE_ACK
Acknowledgement is needed for the data transfer.
Definition: handler.h:1223
void set_loc_index(uint idx)
Set current SE index.
Definition: handler.h:1105
void clear_flags()
Clear all flags set by SE.
Definition: handler.h:1149
handlerton * m_hton
Handlerton for the SE.
Definition: handler.h:1196
uint get_client_buffer_size()
Get caller's transfer buffer size.
Definition: handler.h:1101
uint get_loc_index()
Get current SE index.
Definition: handler.h:1109
const int HA_CLONE_ZERO_COPY
Data file can be transferred with zero copy.
Definition: handler.h:1229
void set_data_desc(const uchar *desc, uint len)
Set data descriptor.
Definition: handler.h:1115
Base class to be used by handlers different shares.
Definition: handler.h:4297
virtual ~Handler_share()=default
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:929
Definition: sql_optimizer.h:133
JSON DOM abstract base class.
Definition: json_dom.h:179
const char * name
Name of key.
Definition: key.h:153
bool is_visible
True if this index is visible to the query optimizer.
Definition: key.h:201
Definition: sql_list.h:494
A granted metadata lock.
Definition: mdl.h:988
Mem_root_allocator is a C++ STL memory allocator based on MEM_ROOT.
Definition: mem_root_allocator.h:68
Definition: overflow_bitset.h:81
Definition: parse_tree_nodes.h:3092
Class for partitioning specific operations.
Definition: partition_handler.h:194
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Class to hold information regarding a predefined tablespace created by a storage engine.
Definition: plugin_table.h:129
This class represents a buffer that can be used for multi-row reads.
Definition: record_buffer.h:47
Implements the row and column memory management for parse and load operations.
Definition: bulk_data_service.h:325
Cost constants for a storage engine.
Definition: opt_costconstants.h:208
Simple intrusive linked list.
Definition: sql_list.h:48
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:169
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: handler.h:7519
Temp_table_handle()
Definition: handler.h:7521
~Temp_table_handle()
Definition: handler.cc:8756
TABLE * open(THD *thd, const char *db_name, const char *table_name)
Open the table handler.
Definition: handler.cc:8726
TABLE * table
Definition: handler.h:7533
Unique_on_insert – similar to above, but rejects duplicates on insert, not just on read of the final ...
Definition: uniques.h:123
Class to maintain list of externally coordinated transactions and their current state at recovery.
Definition: handler.h:1283
enum_ha_recover_xa_state add(XID const &xid, enum_ha_recover_xa_state state)
Adds a transaction and state to the underlying map.
Definition: handler.cc:9141
std::map< XID, enum_ha_recover_xa_state, std::less< XID >, Xa_state_list::allocator >::iterator iterator
Definition: handler.h:1290
enum_ha_recover_xa_state find(XID const &to_find)
Searches the underlying map to find an key that corresponds to the parameter.
Definition: handler.cc:9135
static Xa_state_list::instantiation_tuple new_instance()
Factory like method to instantiate all the infra-structure needed to create an Xa_state_list.
Definition: handler.cc:9173
Xa_state_list(Xa_state_list::list &populated_by_tc)
Class constructor.
Definition: handler.cc:9132
std::pair< const XID, enum_ha_recover_xa_state > pair
Definition: handler.h:1285
Xa_state_list::list & m_underlying
The underlying map holding the trx and states.
Definition: handler.h:1362
std::map< XID, enum_ha_recover_xa_state, std::less< XID >, Xa_state_list::allocator > list
Definition: handler.h:1288
std::tuple< std::unique_ptr< MEM_ROOT >, std::unique_ptr< Xa_state_list::allocator >, std::unique_ptr< Xa_state_list::list >, std::unique_ptr< Xa_state_list > > instantiation_tuple
Definition: handler.h:1293
virtual ~Xa_state_list()=default
The Properties class defines an interface for storing key=value pairs, where both key and value may b...
Definition: properties.h:74
Definition: tablespace.h:56
Definition: handler.h:4265
ha_rows num_distinct_values
Definition: handler.h:4267
ha_column_statistics()
Definition: handler.h:4269
Definition: handler.h:4211
ulonglong index_file_length
Definition: handler.h:4215
uint block_size
Definition: handler.h:4234
ulonglong data_file_length
Definition: handler.h:4213
ulong update_time
Definition: handler.h:4233
ha_rows records
Definition: handler.h:4227
ulonglong max_data_file_length
Definition: handler.h:4214
ulong check_time
Definition: handler.h:4232
time_t create_time
Definition: handler.h:4231
ulonglong max_index_file_length
Definition: handler.h:4216
ulong mean_rec_length
Definition: handler.h:4229
ulonglong auto_increment_value
Definition: handler.h:4218
ha_statistics()
Definition: handler.h:4249
double table_in_mem_estimate
Estimate for how much of the table that is available in a memory buffer.
Definition: handler.h:4247
ulonglong delete_length
Definition: handler.h:4217
uint mrr_length_per_rec
Definition: handler.h:4239
ha_rows deleted
Definition: handler.h:4228
Definition: handler.h:8019
ulonglong m_id
Definition: handler.h:8033
ulonglong m_initial_size
Definition: handler.h:8040
dd::String_type m_row_format
Definition: handler.h:8044
ulonglong m_data_free
Definition: handler.h:8045
ulonglong m_version
Definition: handler.h:8043
dd::String_type m_status
Definition: handler.h:8046
ulonglong m_maximum_size
Definition: handler.h:8041
ulonglong m_logfile_group_number
Definition: handler.h:8036
ulonglong m_free_extents
Definition: handler.h:8037
ha_tablespace_statistics()
Definition: handler.h:8021
ulonglong m_autoextend_size
Definition: handler.h:8042
ulonglong m_total_extents
Definition: handler.h:8038
ulonglong m_extent_size
Definition: handler.h:8039
dd::String_type m_logfile_group_name
Definition: handler.h:8035
dd::String_type m_type
Definition: handler.h:8034
dd::String_type m_extra
Definition: handler.h:8047
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4753
virtual int sample_end(void *scan_ctx)
End sampling.
Definition: handler.cc:3249
KEY_PART_INFO * range_key_part
Definition: handler.h:4813
virtual int ft_read(uchar *)
Definition: handler.h:5987
virtual bool get_foreign_dup_key(char *child_table_name, uint child_table_name_len, char *child_key_name, uint child_key_name_len)
Retrieves the names of the table and the key for which there was a duplicate entry in the case of HA_...
Definition: handler.cc:4772
virtual int repair(THD *, HA_CHECK_OPT *)
In this method check_opt can be modified to specify CHECK option to use to call check() upon the tabl...
Definition: handler.h:7067
ulonglong insert_id_for_cur_row
insert id for the current row (autogenerated; if not autogenerated, it's 0).
Definition: handler.h:4863
virtual bool is_index_algorithm_supported(enum ha_key_alg key_alg) const
Check if SE supports specific key algorithm.
Definition: handler.h:5844
virtual void set_external_table_offload_error(const char *)
Propagates the secondary storage engine offload failure reason for a query to the external engine whe...
Definition: handler.h:7480
virtual double read_time(uint index, uint ranges, ha_rows rows)
The cost of reading a set of ranges from the table using an index to access it.
Definition: handler.h:5492
handler * m_primary_handler
Pointer to the handler of the table in the primary storage engine, if this handler represents a table...
Definition: handler.h:4810
void * Blob_context
Definition: handler.h:4758
virtual ~handler(void)
Definition: handler.h:5014
virtual int open_blob(THD *thd, void *load_ctx, size_t thread_idx, Blob_context &blob_ctx, unsigned char *blobref)
Open a blob for write operation.
Definition: handler.h:5353
int ha_index_init(uint idx, bool sorted)
Initialize use of index.
Definition: handler.cc:3026
virtual int index_prev(uchar *)
Definition: handler.h:5931
virtual FT_INFO * ft_init_ext(uint flags, uint inx, String *key)
Definition: handler.cc:3162
virtual void external_table_offload_error() const
Identifies and throws the propagated external engine query offload or exec failure reason given by th...
Definition: handler.h:7486
virtual uint max_supported_key_length() const
Definition: handler.h:6297
const Item * pushed_cond
Definition: handler.h:4842
void set_ha_table(TABLE *table_arg)
Definition: handler.h:7381
Unique_on_insert * m_unique
Definition: handler.h:4978
virtual int check_foreign_constraints(THD *thd, size_t n_threads) const
Check whether all records in the child table satisfy the foreign key constraints.
Definition: handler.h:5256
virtual int reset()
Reset state of file to after 'open'.
Definition: handler.h:7017
virtual int records_from_index(ha_rows *num_rows, uint index)
Number of rows in table counted using the secondary index chosen by optimizer.
Definition: handler.cc:3296
virtual int open(const char *name, int mode, uint test_if_locked, const dd::Table *table_def)=0
virtual int index_first(uchar *)
Definition: handler.h:5934
Handler_share * get_ha_share_ptr()
Get an initialized ha_share.
Definition: handler.cc:8312
bool m_update_generated_read_fields
Some non-virtual ha_* functions, responsible for reading rows, like ha_rnd_pos(), must ensure that vi...
Definition: handler.h:4975
batch_mode_t
Internal state of the batch instrumentation.
Definition: handler.h:4887
@ PSI_BATCH_MODE_STARTING
Batch mode used, before first table io.
Definition: handler.h:4891
@ PSI_BATCH_MODE_STARTED
Batch mode used, after first table io.
Definition: handler.h:4893
@ PSI_BATCH_MODE_NONE
Batch mode not used.
Definition: handler.h:4889
Discrete_interval auto_inc_interval_for_cur_row
Interval returned by get_auto_increment() and being consumed by the inserter.
Definition: handler.h:4868
void restore_auto_increment(ulonglong prev_insert_id)
Definition: handler.h:6225
bool ha_check_and_repair(THD *thd)
Check and repair table: public interface.
Definition: handler.cc:5043
virtual enum ha_key_alg get_default_index_algorithm() const
Get default key algorithm for SE.
Definition: handler.h:5833
double table_in_memory_estimate() const
Return an estimate of how much of the table that is currently stored in main memory.
Definition: handler.cc:6121
virtual const char * table_type() const =0
The following can be called without an open handler.
virtual Cost_estimate read_cost(uint index, double ranges, double rows)
Cost estimate for reading a set of ranges from the table using an index to access it.
Definition: handler.cc:6259
bool in_range_check_pushed_down
Definition: handler.h:4819
uint ranges_in_seq
Definition: handler.h:4780
uint max_key_parts() const
Definition: handler.h:6284
virtual bool primary_key_is_clustered() const
Check if the primary key is clustered or not.
Definition: handler.h:6384
bool m_virt_gcol_in_end_range
Flag which tells if end_range contains a virtual generated column.
Definition: handler.h:4833
int ha_index_next_pushed(uchar *buf)
Definition: handler.cc:3732
ha_statistics stats
Definition: handler.h:4774
void rebind_psi()
Definition: handler.cc:2861
int ha_update_row(const uchar *old_data, uchar *new_data)
Update the current row.
Definition: handler.cc:8233
int ha_delete_all_rows()
Delete all rows: public interface.
Definition: handler.cc:4991
virtual int index_init(uint idx, bool sorted)
Definition: handler.h:6954
virtual int enable_indexes(uint mode)
Enable indexes again.
Definition: handler.h:7295
int check_collation_compatibility()
Check for incompatible collation changes.
Definition: handler.cc:4659
virtual uint lock_count(void) const
Get number of lock objects returned in store_lock.
Definition: handler.h:6340
std::function< void(void *cookie)> Load_end_cbk
This callback is called by each parallel load thread when processing of rows has ended for the adapte...
Definition: handler.h:5215
virtual int bulk_load_end(THD *thd, void *load_ctx, bool is_error)
End bulk load operation.
Definition: handler.h:5399
virtual const TABLE * parent_of_pushed_join() const
If this handler instance is a child in a pushed join sequence returned TABLE instance being my parent...
Definition: handler.h:6478
virtual uint max_supported_key_parts() const
Definition: handler.h:6296
enum_range_scan_direction range_scan_direction
Definition: handler.h:4803
bool eq_range
Definition: handler.h:4814
virtual int disable_indexes(uint mode)
Disable indexes for a while.
Definition: handler.h:7282
virtual uint extra_rec_buf_length() const
Definition: handler.h:5706
key_range * end_range
End value for a range scan.
Definition: handler.h:4828
virtual void init_table_handle_for_HANDLER()
Definition: handler.h:6270
uint active_index
Definition: handler.h:4836
RANGE_SEQ_IF mrr_funcs
Definition: handler.h:4778
int ha_index_last(uchar *buf)
Reads the last row via index.
Definition: handler.cc:3608
virtual void change_table_ptr(TABLE *table_arg, TABLE_SHARE *share)
Change the internal TABLE_SHARE pointer.
Definition: handler.h:5459
virtual int extra(enum ha_extra_function operation)
Storage engine specific implementation of ha_extra()
Definition: handler.h:6092
virtual void end_bulk_update()
Perform any needed clean-up, no outstanding updates are there at the moment.
Definition: handler.h:5887
int ha_multi_range_read_next(char **range_info)
Definition: handler.cc:6600
int ha_end_bulk_insert()
End bulk insert.
Definition: handler.cc:4964
uint errkey
Definition: handler.h:4834
virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key)
Find number of records in a range.
Definition: handler.h:6024
virtual int multi_range_read_init(RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint mode, HANDLER_BUFFER *buf)
Initialize the MRR scan.
Definition: handler.cc:6588
virtual int multi_range_read_next(char **range_info)
Get next record in MRR scan.
Definition: handler.cc:6630
virtual int update_row(const uchar *old_data, uchar *new_data)
Update a single row.
Definition: handler.h:7004
virtual int index_read_pushed(uchar *, const uchar *, key_part_map)
Definition: handler.h:6490
virtual bool check_if_incompatible_data(HA_CREATE_INFO *create_info, uint table_changes)
Part of old, deprecated in-place ALTER API.
Definition: handler.h:6500
int ha_enable_indexes(uint mode)
Enable indexes: public interface.
Definition: handler.cc:5069
virtual bool is_fatal_error(int error)
Determine whether an error is fatal or not.
Definition: handler.cc:4304
virtual int sample_next(void *scan_ctx, uchar *buf)
Get the next record for sampling.
Definition: handler.cc:3251
double index_in_memory_estimate(uint keyno) const
Return an estimate of how much of the index that is currently stored in main memory.
Definition: handler.cc:6140
bool filter_dup_records()
Filter duplicate records when multi-valued index is used for retrieval.
Definition: handler.cc:8693
int m_lock_type
The lock type set by when calling::ha_external_lock().
Definition: handler.h:4954
handlerton * ht
Definition: handler.h:4768
virtual bool is_ignorable_error(int error)
Determine whether an error can be ignored or not.
Definition: handler.cc:4279
TABLE_SHARE * table_share
Definition: handler.h:4761
int ha_read_range_next()
Definition: handler.cc:7564
int ha_create(const char *name, TABLE *form, HA_CREATE_INFO *info, dd::Table *table_def)
Create a table in the engine: public interface.
Definition: handler.cc:5236
virtual int info(uint flag)=0
General method to gather info from handler.
virtual bool bulk_load_set_source_table_data(void *load_ctx, const std::vector< Bulk_load::Source_table_data > &source_table_data) const
Sets the source table data (table name and key range boundaries) for all loaders.
Definition: handler.h:5288
virtual bool start_read_removal(void)
Start read (before write) removal on the current table.
Definition: handler.h:6124
int ha_sample_end(void *scan_ctx)
End sampling.
Definition: handler.cc:3212
void ha_start_bulk_insert(ha_rows rows)
Start bulk insert.
Definition: handler.cc:4949
int ha_delete_row(const uchar *buf)
Definition: handler.cc:8261
int ha_index_next_same(uchar *buf, const uchar *key, uint keylen)
Reads the next same row via index.
Definition: handler.cc:3644
int ha_index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map)
Definition: handler.cc:3420
virtual void cancel_pushed_idx_cond()
Reset information about pushed index conditions.
Definition: handler.h:6456
int ha_sample_init(void *&scan_ctx, double sampling_percentage, int sampling_seed, enum_sampling_method sampling_method, const bool tablesample)
Initialize sampling.
Definition: handler.cc:3185
virtual size_t bulk_load_available_memory(THD *thd) const
Get the total memory available for bulk load in SE.
Definition: handler.h:5312
virtual void append_create_info(String *packet)
Definition: handler.h:6269
virtual uint max_supported_key_part_length(HA_CREATE_INFO *create_info) const
Definition: handler.h:6298
bool ha_upgrade_table(THD *thd, const char *dbname, const char *table_name, dd::Table *dd_table, TABLE *table_arg)
Set se_private_id and se_private_data during upgrade.
Definition: handler.cc:8603
virtual int check(THD *, HA_CHECK_OPT *)
Definition: handler.h:7060
virtual const Item * cond_push(const Item *cond)
Push condition down to the table handler.
Definition: handler.h:6421
virtual longlong get_memory_buffer_size() const
Return an estimate on the amount of memory the storage engine will use for caching data in memory.
Definition: handler.h:5603
virtual int rnd_next(uchar *buf)=0
virtual void unlock_row()
Unlock last accessed row.
Definition: handler.h:6198
virtual int preload_keys(THD *, HA_CHECK_OPT *)
Definition: handler.h:6256
uint max_keys() const
Definition: handler.h:6281
void ha_statistic_increment(ulonglong System_status_var::*offset) const
Definition: handler.cc:2837
int ha_bulk_update_row(const uchar *old_data, uchar *new_data, uint *dup_key_found)
Bulk update row: public interface.
Definition: handler.cc:4977
virtual double index_only_read_time(uint keynr, double records)
Calculate cost of 'index only' scan for given index and number of records.
Definition: handler.cc:6110
virtual int bulk_load_copy_existing_data(void *load_ctx, size_t thread_idx, Bulk_load::Stat_callbacks &wait_cbk) const
Used during bulk load on a non-empty table, called after the CSV file input is exhausted and we need ...
Definition: handler.h:5269
double m_sampling_percentage
Definition: handler.h:4883
virtual FT_INFO * ft_init_ext_with_hints(uint inx, String *key, Ft_hints *hints)
Definition: handler.h:5974
void set_end_range(const key_range *range, enum_range_scan_direction direction)
Set the end position for a range scan.
Definition: handler.cc:7630
int ha_index_next(uchar *buf)
Reads the next row via index.
Definition: handler.cc:3489
virtual int index_read(uchar *buf, const uchar *key, uint key_len, enum ha_rkey_function find_flag)
Definition: handler.h:7168
int ha_discard_or_import_tablespace(bool discard, dd::Table *table_def)
Discard or import tablespace: public interface.
Definition: handler.cc:5082
uint pushed_idx_cond_keyno
Definition: handler.h:4845
virtual void column_bitmaps_signal()
Signal that the table->read_set and table->write_set table maps changed The handler is allowed to set...
Definition: handler.cc:4106
virtual int close_blob(THD *thd, void *load_ctx, size_t thread_idx, Blob_context blob_ctx, unsigned char *blobref)
Close the blob.
Definition: handler.h:5385
virtual Partition_handler * get_partition_handler()
Definition: handler.h:7433
virtual ha_rows end_read_removal(void)
End read (before write) removal and return the number of rows really written.
Definition: handler.h:6134
HANDLER_BUFFER * multi_range_buffer
Definition: handler.h:4779
const TABLE * get_table() const
Definition: handler.h:5464
uchar * ref
Pointer to current row.
Definition: handler.h:4770
int ha_reset()
Check handler usage and reset state of file to after 'open'.
Definition: handler.cc:8177
virtual int index_next_same(uchar *buf, const uchar *key, uint keylen)
Definition: handler.cc:5303
virtual bool was_semi_consistent_read()
Definition: handler.h:6182
int ha_records(ha_rows *num_rows, uint index)
Wrapper function to call records_from_index() in storage engine.
Definition: handler.h:5802
virtual Cost_estimate index_scan_cost(uint index, double ranges, double rows)
Cost estimate for reading a number of ranges from an index.
Definition: handler.cc:6239
int ha_check(THD *thd, HA_CHECK_OPT *check_opt)
to be actually called to get 'check()' functionality
Definition: handler.cc:4846
virtual int load_table(const TABLE &table, bool *skip_metadata_update)
Loads a table into its defined secondary storage engine.
Definition: handler.h:7138
virtual int index_next(uchar *)
Definition: handler.h:5928
int ha_read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range, bool sorted)
Definition: handler.cc:7545
virtual void update_create_info(HA_CREATE_INFO *create_info)
Update create info as part of ALTER TABLE.
Definition: handler.h:6251
virtual int rnd_end()
Definition: handler.h:6970
uint key_used_on_scan
Definition: handler.h:4835
virtual ha_rows multi_range_read_info(uint keyno, uint n_ranges, uint keys, uint *bufsz, uint *flags, Cost_estimate *cost)
Get cost and other information about MRR scan over some sequence of ranges.
Definition: handler.cc:6529
@ SAMPLING
Definition: handler.h:4840
@ NONE
Definition: handler.h:4840
@ INDEX
Definition: handler.h:4840
@ RND
Definition: handler.h:4840
virtual Cost_estimate table_scan_cost()
Cost estimate for doing a complete table scan.
Definition: handler.cc:6225
virtual ulong index_flags(uint idx, uint part, bool all_parts) const =0
virtual int external_lock(THD *thd, int lock_type)
Is not invoked for non-transactional temporary tables.
Definition: handler.h:7053
virtual int parallel_scan_init(void *&scan_ctx, size_t *num_threads, bool use_reserved_threads, size_t max_desired_threads)
Initializes a parallel scan.
Definition: handler.h:5165
int ha_extra(enum ha_extra_function operation)
Request storage engine to do an extra operation: enable,disable or run some functionality.
Definition: handler.cc:8699
ulonglong next_insert_id
next_insert_id is the next value which should be inserted into the auto_increment column: in a insert...
Definition: handler.h:4856
virtual bool low_byte_first() const
Definition: handler.h:6306
void ha_set_primary_handler(handler *primary_handler)
Store a pointer to the handler of the primary table that corresponds to the secondary table in this h...
Definition: handler.cc:9012
uint ref_length
Length of ref (1-8 or the clustered key length)
Definition: handler.h:4838
virtual double scan_time()
Definition: handler.h:5473
int ha_analyze(THD *thd, HA_CHECK_OPT *check_opt)
Analyze table: public interface.
Definition: handler.cc:5030
virtual uint max_supported_record_length() const
Definition: handler.h:6294
virtual enum_alter_inplace_result check_if_supported_inplace_alter(TABLE *altered_table, Alter_inplace_info *ha_alter_info)
Check if a storage engine supports a particular alter table in-place.
Definition: handler.cc:5126
ulonglong Table_flags
Definition: handler.h:4757
virtual void parallel_scan_end(void *scan_ctx)
End of the parallel scan.
Definition: handler.h:5242
bool ha_commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, const dd::Table *old_table_def, dd::Table *new_table_def)
Public function wrapping the actual handler call.
Definition: handler.cc:5101
PSI_table_share * ha_table_share_psi(const TABLE_SHARE *share) const
Acquire the instrumented table information from a table share.
Definition: handler.cc:2895
int get_lock_type() const
Definition: handler.h:7383
std::function< bool(void *cookie, ulong ncols, ulong row_len, const ulong *col_offsets, const ulong *null_byte_offsets, const ulong *null_bitmasks)> Load_init_cbk
This callback is called by each parallel load thread at the beginning of the parallel load for the ad...
Definition: handler.h:5193
Table_flags ha_table_flags() const
The cached_table_flags is set at ha_open and ha_external_lock.
Definition: handler.h:5100
int ha_load_table(const TABLE &table, bool *skip_metadata_update)
Loads a table into its defined secondary storage engine: public interface.
Definition: handler.cc:5254
virtual int extra_opt(enum ha_extra_function operation, ulong cache_size)
Definition: handler.h:6097
void ha_drop_table(const char *name)
Drop table in the engine: public interface.
Definition: handler.cc:5223
bool ha_prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def)
Public functions wrapping the actual handler call.
Definition: handler.cc:5090
void start_psi_batch_mode()
Put the handler in 'batch' mode when collecting table io instrumented events.
Definition: handler.cc:2874
int ha_index_or_rnd_end()
Definition: handler.h:5094
virtual bool is_crashed() const
Check if the table is crashed.
Definition: handler.h:6316
int ha_truncate(dd::Table *table_def)
Truncate table: public interface.
Definition: handler.cc:5004
virtual int close(void)=0
int ha_index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag)
Read [part of] row via [part of] index.
Definition: handler.cc:3390
int ha_sample_next(void *scan_ctx, uchar *buf)
Get the next record for sampling.
Definition: handler.cc:3223
void unbind_psi()
Definition: handler.cc:2849
virtual int assign_to_keycache(THD *, HA_CHECK_OPT *)
Definition: handler.h:6253
virtual std::string bulk_load_generate_temporary_table_name() const
Generates a temporary table name to be used for table duplication during bulk load.
Definition: handler.h:5279
virtual bool start_bulk_update()
Definition: handler.h:5862
uchar * dup_ref
Pointer to duplicate row.
Definition: handler.h:4772
bool end_psi_batch_mode_if_started()
If a PSI batch was started, turn if off.
Definition: handler.h:4941
virtual ha_rows multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, void *seq_init_param, uint n_ranges, uint *bufsz, uint *flags, bool *force_default_mrr, Cost_estimate *cost)
Get cost and other information about MRR scan over a known list of ranges.
Definition: handler.cc:6360
int ha_check_for_upgrade(HA_CHECK_OPT *check_opt)
Definition: handler.cc:4691
handler * ha_get_primary_handler() const
Get a pointer to a handler for the table in the primary storage engine, if this handler is for a tabl...
Definition: handler.h:7463
bool ha_get_se_private_data(dd::Table *dd_table, bool reset)
Submit a dd::Table object representing a core DD table having hardcoded data to be filled in by the D...
Definition: handler.cc:5273
virtual uint32 calculate_key_hash_value(Field **field_array)
Definition: handler.h:6065
uint max_record_length() const
Definition: handler.h:6278
void unlock_shared_ha_data()
Release lock for protecting ha_share.
Definition: handler.cc:8358
void mark_trx_read_write()
A helper function to mark a transaction read-write, if it is started.
Definition: handler.cc:4872
virtual uint number_of_pushed_joins() const
Reports number of tables included in pushed join which this handler instance is part of.
Definition: handler.h:6466
virtual int sample_init(void *&scan_ctx, double sampling_percentage, int sampling_seed, enum_sampling_method sampling_method, const bool tablesample)
Initialize sampling.
Definition: handler.cc:3244
PSI_table * m_psi
Instrumented table associated with this handler.
Definition: handler.h:4880
virtual int discard_or_import_tablespace(bool discard, dd::Table *table_def)
Discard or import tablespace.
Definition: handler.h:7314
virtual int exec_bulk_update(uint *dup_key_found)
After this call all outstanding updates must be performed.
Definition: handler.h:5879
int update_auto_increment()
Definition: handler.cc:3903
virtual int indexes_are_disabled(void)
Check if indexes are disabled.
Definition: handler.h:6268
Record_buffer * ha_get_record_buffer() const
Get the record buffer that was set with ha_set_record_buffer().
Definition: handler.h:5049
virtual Table_flags table_flags(void) const =0
THD * ha_thd() const
Definition: handler.cc:2842
batch_mode_t m_psi_batch_mode
Batch mode state.
Definition: handler.h:4900
virtual int index_read_last(uchar *buf, const uchar *key, uint key_len)
Definition: handler.h:7174
virtual int start_stmt(THD *thd, thr_lock_type lock_type)
Start a statement when table is locked.
Definition: handler.h:6213
virtual const TABLE * member_of_pushed_join() const
If this handler instance is part of a pushed join sequence returned TABLE instance being root of the ...
Definition: handler.h:6472
virtual int index_next_pushed(uchar *)
Definition: handler.h:6494
FT_INFO * ft_handler
Definition: handler.h:4839
int ha_index_read_pushed(uchar *buf, const uchar *key, key_part_map keypart_map)
Definition: handler.cc:3716
virtual const handlerton * hton_supporting_engine_pushdown()
Get the handlerton of the storage engine if the SE is capable of pushing down some of the AccessPath ...
Definition: handler.h:6116
virtual bool is_record_buffer_wanted(ha_rows *const max_rows) const
Does this handler want to get a Record_buffer for multi-row reads via the ha_set_record_buffer() func...
Definition: handler.h:7090
Handler_share ** ha_share
Pointer where to store/retrieve the Handler_share pointer.
Definition: handler.h:4959
virtual handler * clone(const char *name, MEM_ROOT *mem_root)
Definition: handler.cc:2805
int ha_optimize(THD *thd, HA_CHECK_OPT *check_opt)
Optimize table: public interface.
Definition: handler.cc:5017
Table_flags cached_table_flags
Definition: handler.h:4763
virtual int analyze(THD *, HA_CHECK_OPT *)
Definition: handler.h:7256
int ha_external_lock(THD *thd, int lock_type)
These functions represent the public interface to users of the handler class, hence they are not virt...
Definition: handler.cc:8134
virtual void notify_table_changed(Alter_inplace_info *ha_alter_info)
Notify the storage engine that the table definition has been updated.
Definition: handler.h:6875
handler(handlerton *ht_arg, TABLE_SHARE *share_arg)
Definition: handler.h:4981
virtual uint max_supported_keys() const
Definition: handler.h:6295
virtual int records(ha_rows *num_rows)
Number of rows in table.
Definition: handler.cc:3262
virtual int rnd_init(bool scan)=0
rnd_init() can be called two times without rnd_end() in between (it only makes sense if scan=1).
uint max_key_length() const
Definition: handler.h:6287
range_seq_t mrr_iter
Definition: handler.h:4777
int handle_records_error(int error, ha_rows *num_rows)
Function will handle the error code from call to records() and records_from_index().
Definition: handler.cc:3336
virtual int rename_table(const char *from, const char *to, const dd::Table *from_table_def, dd::Table *to_table_def)
Default rename_table() and delete_table() rename/delete files with a given name and extensions from h...
Definition: handler.cc:4805
int ha_records(ha_rows *num_rows)
Wrapper function to call records() in storage engine.
Definition: handler.h:5790
void lock_shared_ha_data()
Take a lock for protecting shared handler data.
Definition: handler.cc:8348
PSI_table_locker * m_psi_locker
The current event in a batch.
Definition: handler.h:4912
int ha_open(TABLE *table, const char *name, int mode, int test_if_locked, const dd::Table *table_def)
Definition: handler.cc:2925
virtual void start_bulk_insert(ha_rows)
Definition: handler.h:7071
static bool my_prepare_gcolumn_template(THD *thd, const char *db_name, const char *table_name, my_gcolumn_template_callback_t myc, void *ib_table)
Callback to allow InnoDB to prepare a template for generated column processing.
Definition: handler.cc:8625
virtual bool inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def)
Alter the table structure in-place with operations specified using HA_ALTER_FLAGS and Alter_inplace_i...
Definition: handler.h:6787
virtual bool bulk_load_check(THD *thd) const
Check if the table is ready for bulk load.
Definition: handler.h:5247
uint get_index(void) const
Definition: handler.h:5856
virtual int read_range_first(const key_range *start_key, const key_range *end_key, bool eq_range_arg, bool sorted)
Read first row between two ranges.
Definition: handler.cc:7515
virtual void * bulk_load_begin(THD *thd, size_t keynr, size_t data_size, size_t memory, size_t num_threads)
Begin parallel bulk data load to the table.
Definition: handler.h:5322
int ha_delete_table(const char *name, const dd::Table *table_def)
Delete table: public interface.
Definition: handler.cc:5210
virtual void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values)
Reserves an interval of auto_increment values from the handler.
Definition: handler.cc:4128
virtual bool prepare_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def)
Allows the storage engine to update internal structures with concurrent writes blocked.
Definition: handler.h:6750
std::mt19937 * m_random_number_engine
Definition: handler.h:4882
virtual uint min_record_length(uint options) const
Definition: handler.h:6302
void init()
This is called after create to allow us to set up cached variables.
Definition: handler.h:5032
void set_ha_share_ptr(Handler_share *arg_ha_share)
Set ha_share to be used by all instances of the same table/partition.
Definition: handler.cc:8333
virtual std::string explain_extra() const
Return extra handler specific text for EXPLAIN.
Definition: handler.h:5025
virtual int write_row(uchar *buf)
Write a row.
Definition: handler.h:6992
virtual void try_semi_consistent_read(bool)
Tell the engine whether it should avoid unnecessary lock waits.
Definition: handler.h:6189
enum_range_scan_direction
Definition: handler.h:4794
@ RANGE_SCAN_ASC
Definition: handler.h:4794
@ RANGE_SCAN_DESC
Definition: handler.h:4794
void end_psi_batch_mode()
End a batch started with start_psi_batch_mode.
Definition: handler.cc:2883
void set_next_insert_id(ulonglong id)
Definition: handler.h:6221
virtual int ft_init()
Definition: handler.h:5972
int compare_key_icp(const key_range *range) const
Definition: handler.cc:7714
TABLE * table
Definition: handler.h:4762
void ha_notify_table_changed(Alter_inplace_info *ha_alter_info)
Public function wrapping the actual handler call.
Definition: handler.h:6708
int ha_index_prev(uchar *buf)
Reads the previous row via index.
Definition: handler.cc:3534
int ha_rnd_pos(uchar *buf, uchar *pos)
Read row via random scan from position.
Definition: handler.cc:3142
int ha_index_first(uchar *buf)
Reads the first row via index.
Definition: handler.cc:3570
bool ha_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, const dd::Table *old_table_def, dd::Table *new_table_def)
Public function wrapping the actual handler call.
Definition: handler.h:6684
Record_buffer * m_record_buffer
Buffer for multi-row reads.
Definition: handler.h:4797
void ha_release_auto_increment()
Definition: handler.cc:4192
virtual int truncate(dd::Table *table_def)
Quickly remove all rows from a table.
Definition: handler.h:7250
virtual int index_end()
Definition: handler.h:6958
virtual table_map tables_in_pushed_join() const
Definition: handler.h:6482
virtual int delete_all_rows()
Delete all rows in a table.
Definition: handler.h:7215
virtual int rnd_pos_by_record(uchar *record)
This function only works for handlers having HA_PRIMARY_KEY_REQUIRED_FOR_POSITION set.
Definition: handler.h:5995
virtual void drop_table(const char *name)
Definition: handler.cc:4826
virtual int unload_table(const char *db_name, const char *table_name, bool error_if_not_loaded)
Unloads a table from its defined secondary storage engine.
Definition: handler.h:7158
void ha_mv_key_capacity(uint *num_keys, size_t *keys_length) const
Return max limits for a single set of multi-valued keys.
Definition: handler.h:7471
virtual bool bulk_load_get_row_id_range(size_t &min, size_t &max) const
Get the row ID range of the table that we're bulk loading into.
Definition: handler.h:5300
virtual int optimize(THD *, HA_CHECK_OPT *)
Definition: handler.h:7253
int ha_index_read_idx_map(uchar *buf, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag)
Initializes an index and read it.
Definition: handler.cc:3450
virtual int bulk_update_row(const uchar *old_data, uchar *new_data, uint *dup_key_found)
This method is similar to update_row, however the handler doesn't need to execute the updates at this...
Definition: handler.h:7198
virtual bool check_and_repair(THD *thd)
Check and repair the table if necessary.
Definition: handler.h:7271
virtual bool auto_repair() const
Check if the table can be automatically repaired.
Definition: handler.h:6325
virtual int end_bulk_insert()
Definition: handler.h:7072
virtual int index_read_idx_map(uchar *buf, uint index, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag)
Positions an index cursor to the index specified in argument.
Definition: handler.cc:7775
virtual bool start_bulk_delete()
Definition: handler.h:5867
uint auto_inc_intervals_count
Number of reserved auto-increment intervals.
Definition: handler.h:4875
void ha_set_record_buffer(Record_buffer *buffer)
Set a record buffer that the storage engine can use for multi-row reads.
Definition: handler.h:5042
virtual ha_checksum checksum() const
Definition: handler.h:6307
virtual void mv_key_capacity(uint *num_keys, size_t *keys_length) const
Engine-specific function for ha_can_store_mv_keys().
Definition: handler.h:7494
static bool my_eval_gcolumn_expr_with_open(THD *thd, const char *db_name, const char *table_name, const MY_BITMAP *const fields, uchar *record, const char **mv_data_ptr, ulong *mv_length)
Callback for generated columns processing.
Definition: handler.cc:8663
virtual bool get_se_private_data(dd::Table *dd_table, bool reset)
Definition: handler.h:7345
int ha_repair(THD *thd, HA_CHECK_OPT *check_opt)
Repair table: public interface.
Definition: handler.cc:4926
int ha_rnd_next(uchar *buf)
Read next row via random scan.
Definition: handler.cc:3111
virtual void position(const uchar *record)=0
void adjust_next_insert_id_after_explicit_value(ulonglong nr)
Definition: handler.cc:3778
void(* my_gcolumn_template_callback_t)(const TABLE *, void *)
Callback function that will be called by my_prepare_gcolumn_template once the table has been opened.
Definition: handler.h:7389
int ha_rnd_end()
End use of random access.
Definition: handler.cc:3089
uint get_dup_key(int error)
Definition: handler.cc:4762
virtual bool upgrade_table(THD *thd, const char *dbname, const char *table_name, dd::Table *dd_table)
Definition: handler.h:7096
int ha_write_row(uchar *buf)
Definition: handler.cc:8205
virtual int delete_table(const char *name, const dd::Table *table_def)
Delete a table.
Definition: handler.cc:4777
virtual int get_extra_columns_and_keys(const HA_CREATE_INFO *create_info, const List< Create_field > *create_list, const KEY *key_info, uint key_count, dd::Table *table_obj)
Adjust definition of table to be created by adding implicit columns and indexes necessary for the sto...
Definition: handler.h:7368
virtual void use_hidden_primary_key()
use_hidden_primary_key() is called in case of an update/delete when (table_flags() and HA_PRIMARY_KEY...
Definition: handler.cc:8296
int ha_ft_read(uchar *buf)
Definition: handler.cc:3169
key_range save_end_range
Definition: handler.h:4802
PSI_table_locker_state m_psi_locker_state
Storage for the event in a batch.
Definition: handler.h:4918
ha_rows estimation_rows_to_insert
Definition: handler.h:4765
virtual int rnd_pos(uchar *buf, uchar *pos)=0
virtual int bulk_load_execute(THD *thd, void *load_ctx, size_t thread_idx, const Rows_mysql &rows, Bulk_load::Stat_callbacks &wait_cbk)
Execute bulk load operation.
Definition: handler.h:5337
bool mrr_is_output_sorted
Definition: handler.h:4782
virtual int index_read_last_map(uchar *buf, const uchar *key, key_part_map keypart_map)
The following functions works like index_read, but it find the last row with the current key value or...
Definition: handler.h:5947
int ha_close(void)
Close handler.
Definition: handler.cc:2995
uint max_key_part_length(HA_CREATE_INFO *create_info) const
Definition: handler.h:6290
virtual bool set_ha_share_ref(Handler_share **arg_ha_share)
Definition: handler.h:7376
virtual void release_auto_increment()
Definition: handler.h:7057
const TABLE_SHARE * get_table_share() const
Definition: handler.h:5463
virtual int read_range_next()
Read next row between two endpoints.
Definition: handler.cc:7592
int ha_read_first_row(uchar *buf, uint primary_key)
Read first row (only) from a table.
Definition: handler.cc:3686
virtual ha_rows estimate_rows_upper_bound()
Return upper bound of current number of records in the table (max.
Definition: handler.h:5812
bool has_transactions()
Definition: handler.h:5703
virtual int delete_row(const uchar *buf)
Definition: handler.h:7009
Item * pushed_idx_cond
Definition: handler.h:4844
virtual bool is_table_empty() const
Determines whether the table this handler was opened on is empty.
Definition: handler.h:5307
int compare_key_in_buffer(const uchar *buf) const
Check if the key in the given buffer (which is not necessarily TABLE::record[0]) is within range.
Definition: handler.cc:7750
virtual int parallel_scan(void *scan_ctx, void **thread_ctxs, Load_init_cbk init_fn, Load_cbk load_fn, Load_end_cbk end_fn)
Run the parallel read of data.
Definition: handler.h:5230
virtual int check_for_upgrade(HA_CHECK_OPT *)
admin commands - called from mysql_admin_table
Definition: handler.h:7059
int ha_disable_indexes(uint mode)
Disable indexes: public interface.
Definition: handler.cc:5056
double estimate_in_memory_buffer(ulonglong table_index_size) const
Make a guesstimate for how much of a table or index is in a memory buffer in the case where the stora...
Definition: handler.cc:6168
virtual int index_last(uchar *)
Definition: handler.h:5937
virtual double page_read_cost(uint index, double reads)
Cost estimate for doing a number of non-sequentially accesses against the storage engine.
Definition: handler.cc:6278
virtual Item * idx_cond_push(uint keyno, Item *idx_cond)
Push down an index condition to the handler.
Definition: handler.h:6451
int key_compare_result_on_equal
Definition: handler.h:4804
int compare_key(key_range *range)
Compare if found key (in row) is over max-value.
Definition: handler.cc:7673
KEY_MULTI_RANGE mrr_cur_range
Definition: handler.h:4787
bool mrr_have_range
Definition: handler.h:4785
virtual int cmp_ref(const uchar *ref1, const uchar *ref2) const
Compare two positions.
Definition: handler.h:6397
bool ha_is_record_buffer_wanted(ha_rows *const max_rows) const
Does this handler want to get a Record_buffer for multi-row reads via the ha_set_record_buffer() func...
Definition: handler.h:5066
ulonglong m_psi_numrows
The number of rows in the batch.
Definition: handler.h:4906
virtual bool commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_info *ha_alter_info, bool commit, const dd::Table *old_table_def, dd::Table *new_table_def)
Commit or rollback the changes made during prepare_inplace_alter_table() and inplace_alter_table() in...
Definition: handler.h:6845
virtual int end_bulk_delete()
Execute all outstanding deletes and close down the bulk delete.
Definition: handler.h:5894
virtual int create(const char *name, TABLE *form, HA_CREATE_INFO *info, dd::Table *table_def)=0
Create table (implementation).
virtual double worst_seek_times(double reads)
Provide an upper cost-limit of doing a specified number of seek-and-read key lookups.
Definition: handler.cc:6292
int ha_rename_table(const char *from, const char *to, const dd::Table *from_table_def, dd::Table *to_table_def)
Rename table: public interface.
Definition: handler.cc:5195
virtual enum row_type get_real_row_type(const HA_CREATE_INFO *create_info) const
Get real row type for the table created based on one specified by user, CREATE TABLE options and SE c...
Definition: handler.h:5820
virtual int index_read_map(uchar *buf, const uchar *key, key_part_map keypart_map, enum ha_rkey_function find_flag)
Positions an index cursor to the index specified in the handle ('active_index').
Definition: handler.h:5907
std::function< bool(void *cookie, uint nrows, void *rowdata, uint64_t partition_id)> Load_cbk
This callback is called by each parallel load thread when processing of rows is required for the adap...
Definition: handler.h:5208
int ha_index_end()
End use of index.
Definition: handler.cc:3046
virtual THR_LOCK_DATA ** store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type)=0
Is not invoked for non-transactional temporary tables.
int ha_unload_table(const char *db_name, const char *table_name, bool error_if_not_loaded)
Unloads a table from its defined secondary storage engine: public interface.
Definition: handler.cc:5263
int ha_rnd_init(bool scan)
Initialize table for random read or scan.
Definition: handler.cc:3070
static bool my_eval_gcolumn_expr(THD *thd, TABLE *table, const MY_BITMAP *const fields, uchar *record, const char **mv_data_ptr, ulong *mv_length, bool include_stored_gcols)
Callback for computing generated column values.
Definition: handler.cc:8681
virtual bool get_error_message(int error, String *buf)
Return an error message specific to this handler.
Definition: handler.cc:4645
int ha_check_foreign_constraints(THD *thd, size_t n_threads)
Definition: handler.cc:4863
bool implicit_emptied
Definition: handler.h:4841
virtual void print_error(int error, myf errflag)
Print error that we got from handler function.
Definition: handler.cc:4339
virtual int write_blob(THD *thd, void *load_ctx, size_t thread_idx, Blob_context blob_ctx, unsigned char *blobref, const unsigned char *data, size_t data_len)
Write to a blob.
Definition: handler.h:5369
In-place alter handler context.
Definition: handler.h:3508
virtual void set_shared_data(const inplace_alter_handler_ctx *ctx)
Definition: handler.h:3512
virtual ~inplace_alter_handler_ctx()=default
inplace_alter_handler_ctx()=default
Definition: partition_info.h:209
Legacy struct for passing tablespace information to SEs.
Definition: handler.h:893
ts_command_type ts_cmd_type
Definition: handler.h:897
bool wait_until_completed
Definition: handler.h:910
ulonglong undo_buffer_size
Definition: handler.h:903
ulonglong extent_size
Definition: handler.h:902
st_alter_tablespace(const char *tablespace, const char *logfile_group, ts_command_type cmd, enum ts_alter_tablespace_type alter_tablespace_cmd, const char *datafile, const char *undofile, const Tablespace_options &opts)
Proper constructor even for all-public class simplifies initialization and allows members to be const...
Definition: sql_tablespace.cc:93
const char * logfile_group_name
Definition: handler.h:896
ulonglong file_block_size
Definition: handler.h:908
const char * encryption
Definition: handler.h:912
const char * undo_file_name
Definition: handler.h:901
const char * tablespace_name
Definition: handler.h:895
const char * ts_comment
Definition: handler.h:911
std::optional< ulonglong > autoextend_size
Definition: handler.h:906
ulonglong redo_buffer_size
Definition: handler.h:904
ulonglong max_size
Definition: handler.h:907
ulonglong initial_size
Definition: handler.h:905
const char * data_file_name
Definition: handler.h:900
uint nodegroup_id
Definition: handler.h:909
bool is_tablespace_command()
Definition: handler.h:914
A table definition from the master.
Definition: rpl_utility.h:250
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
#define U
Definition: ctype-tis620.cc:73
static bool report_error(THD *thd, int error_code, Sql_condition::enum_severity_level level, Args... args)
Definition: error_handler.cc:291
Some definitions for full-text indices.
ft_operation
Operation types, used in FT_HINTS.
Definition: ft_global.h:99
@ FT_OP_UNDEFINED
Definition: ft_global.h:100
struct PSI_table_locker PSI_table_locker
Definition: psi_table_bits.h:43
struct PSI_table_share PSI_table_share
Definition: psi_table_bits.h:100
struct PSI_table PSI_table
Definition: psi_table_bits.h:107
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
#define IN_MEMORY_ESTIMATE_UNKNOWN
If the "in memory estimate" for a table (in ha_statistics.table_in_mem_estimate) or index (in KEY::m_...
Definition: key.h:111
constexpr const LEX_CSTRING NULL_CSTR
Definition: lex_string.h:48
A better implementation of the UNIX ctype(3) library.
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
void destroy_at(T *ptr)
Definition: my_alloc.h:462
This file includes constants used by all storage engines.
#define HA_OPTION_PACK_RECORD
Indicates that storage engine needs to use packed row format.
Definition: my_base.h:607
#define rows2double(A)
Definition: my_base.h:1227
ha_panic_function
Definition: my_base.h:436
ha_key_alg
Definition: my_base.h:98
@ HA_KEY_ALG_SE_SPECIFIC
Used for cases when key algorithm which is supported by SE can't be described by one of other classes...
Definition: my_base.h:107
#define HA_ERR_UNSUPPORTED
unsupported extension used
Definition: my_base.h:942
ha_rkey_function
Definition: my_base.h:78
ulong key_part_map
Definition: my_base.h:1095
my_off_t ha_rows
Definition: my_base.h:1228
ha_extra_function
Definition: my_base.h:185
#define HA_POS_ERROR
Definition: my_base.h:1230
#define HA_ERR_WRONG_COMMAND
Command not supported.
Definition: my_base.h:928
#define HA_OPTION_COMPRESS_RECORD
Flag indicating that table is compressed.
Definition: my_base.h:633
ha_storage_media
Definition: my_base.h:116
@ HA_SM_DEFAULT
Definition: my_base.h:117
Abstraction functions over zlib/intrinsics.
std::uint32_t ha_checksum
Definition: my_checksum.h:106
Header for compiler-dependent features.
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
Utility functions for converting between ulonglong and double.
#define ulonglong2double(A)
Definition: my_double2ulonglong.h:46
Some integer typedefs for easier portability.
int myf
Definition: my_inttypes.h:94
unsigned long long int ulonglong
Definition: my_inttypes.h:56
ulonglong my_off_t
Definition: my_inttypes.h:72
unsigned char uchar
Definition: my_inttypes.h:52
long long int longlong
Definition: my_inttypes.h:55
uint64_t uint64
Definition: my_inttypes.h:69
uint32_t uint32
Definition: my_inttypes.h:67
Common #defines and includes for file and socket I/O.
constexpr const size_t IO_SIZE
Definition: my_io.h:163
Common header for many mysys elements.
uint64_t table_map
Definition: my_table_map.h:30
void set_my_errno(int my_errno)
Set the MySQL thread-local storage variant of errno.
Definition: my_thr_init.cc:366
static char * query
Definition: myisam_ftdump.cc:47
static HashTable ht
Definition: mysql.cc:162
static bool interrupted
Definition: mysqladmin.cc:73
void error(const char *format,...)
static char * path
Definition: mysqldump.cc:151
struct stats stats
Definition: mysqlslap.cc:241
static Secondary_engine * secondary_engine
Definition: mysqltest.cc:260
static int record
Definition: mysqltest.cc:195
bool is_temp_table(const HA_CREATE_INFO &ci)
Definition: sql_table.cc:237
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
constexpr value_type primary_key
Definition: classic_protocol_constants.h:269
static PFS_engine_table_share_proxy share
Definition: connection_control_pfs_table.cc:92
std::string dir
Double write files location.
Definition: buf0dblwr.cc:81
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:44
unsigned long long Object_id
Definition: object_id.h:31
enum_column_types
Definition: column.h:53
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
bool index(const std::string &value, const String &search_for, uint32_t *idx)
Definition: contains.h:76
Definition: hypergraph.cc:30
void print(trx_t *trx, dict_index_t *index, std::ostream &out, ref_t ref, bool fatal)
Print information about the given LOB.
Definition: lob0impl.cc:1319
std::string file_name(Log_file_id file_id)
Provides name of the log file with the given file id, e.g.
Definition: log0pre_8_0_30.cc:45
Definition: aligned_atomic.h:44
entry::Table Table
Definition: select.h:51
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
ValueType max(X &&first)
Definition: gtid.h:103
std::string join(const detail::range auto &rng, std::string_view delim)
join elements of a range into a string separated by a delimiter.
Definition: string.h:74
size_t size(const char *const c)
Definition: base64.h:46
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
size_t buffer_size(const ConstBufferSequence &buffers) noexcept
Definition: buffer.h:313
Definition: options.cc:57
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
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2724
static int exists(node_address *name, node_list const *nodes, u_int with_uid)
Definition: node_list.cc:107
OverflowBitset is a fixed-size (once allocated) bitmap that is optimized for the common case of few e...
int(* Page_Track_Callback)(MYSQL_THD thd, const unsigned char *buffer, size_t buf_len, int num_pages, void *user_ctx)
Page tracking callback function.
Definition: page_track_service.h:66
struct result result
Definition: result.h:34
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
required uint64 version
Definition: replication_group_member_actions.proto:41
required string type
Definition: replication_group_member_actions.proto:34
ulonglong prev_insert_id(ulonglong nr, struct System_variables *variables)
Computes the largest number X:
Definition: handler.cc:3803
constexpr const uint64_t HA_CREATE_USED_EXTERNAL_FILES
Definition: handler.h:823
void trans_register_ha(THD *thd, bool all, handlerton *ht, const ulonglong *trxid)
Register a storage engine for a transaction.
Definition: handler.cc:1368
bool(* sdi_get_t)(const dd::Tablespace &tablespace, const sdi_key_t *sdi_key, void *sdi, uint64 *sdi_len)
Retrieve SDI for a given SDI key.
Definition: handler.h:1798
int ha_finalize_handlerton(st_plugin_int *plugin)
Definition: handler.cc:734
bool(* ddse_dict_init_t)(dict_init_mode_t dict_init_mode, uint version, List< const dd::Object_table > *DDSE_tables, List< const Plugin_tablespace > *DDSE_tablespaces)
Definition: handler.h:1932
handlerton * ha_checktype(THD *thd, enum legacy_db_type database_type, bool no_substitute, bool report_error)
Use other database handler if databasehandler is not compiled in.
Definition: handler.cc:576
bool(* qc_engine_callback)(THD *thd, const char *table_key, uint key_length, ulonglong *engine_data)
Definition: handler.h:148
int(* savepoint_set_t)(handlerton *hton, THD *thd, void *sv)
sv points to an uninitialized storage area of requested size (see savepoint_offset description)
Definition: handler.h:1401
bool(* show_status_t)(handlerton *hton, THD *thd, stat_print_fn *print, enum ha_stat_type stat)
Definition: handler.h:1538
bool(*)(const THD *thd, std::string_view reason) set_secondary_engine_offload_fail_reason_t
Sets a specific secondary engine offload failure reason for a query represented by the thread context...
Definition: handler.h:2570
#define UNDEF_NODEGROUP
Definition: handler.h:860
static const uint32 HTON_FKS_WITH_ANY_PREFIX_SUPPORTING_KEYS
Storage engine supports non-hash keys which have common prefix with the foreign key as supporting key...
Definition: handler.h:3306
int(*)(uint64_t *purge_id) page_track_purge_t
Purge page tracking data.
Definition: handler.h:2776
bool(* sdi_set_t)(handlerton *hton, const dd::Tablespace &tablespace, const dd::Table *table, const sdi_key_t *sdi_key, const void *sdi, uint64 sdi_len)
Insert/Update SDI for a given SDI key.
Definition: handler.h:1813
int ha_rollback_low(THD *thd, bool all)
Definition: handler.cc:2066
bool ha_notify_exclusive_mdl(THD *thd, const MDL_key *mdl_key, ha_notification_type notification_type, bool *victimized)
Notify/get permission from all interested storage engines before acquisition or after release of excl...
Definition: handler.cc:8832
size_t num_hton2plugins()
Returns the size of the array holding pointers to plugins.
Definition: handler.cc:243
int ha_find_files(THD *thd, const char *db, const char *path, const char *wild, bool dir, List< LEX_STRING > *files)
Definition: handler.cc:5907
bool(* dict_recover_t)(dict_recovery_mode_t dict_recovery_mode, uint version)
Do recovery in the DDSE as part of initializing the data dictionary.
Definition: handler.h:1985
int(*)(handlerton *hton, THD *thd, const uchar *&loc, uint &loc_len, uint &task_id, Ha_clone_mode mode, const char *data_dir) Clone_apply_begin_t
Begin apply to destination database.
Definition: handler.h:2275
void(* reset_plugin_vars_t)(THD *thd)
Some plugin session variables may require some special handling upon clean up.
Definition: handler.h:1389
constexpr const uint32 SDI_TYPE_TABLE
Id for identifying Table SDIs.
Definition: handler.h:129
void ha_kill_connection(THD *thd)
Definition: handler.cc:1029
enum_ha_recover_xa_state
Enumeration of possible states for externally coordinated transactions (XA).
Definition: handler.h:1263
@ COMMITTED_WITH_ONEPHASE
#define COMPATIBLE_DATA_NO
Definition: handler.h:854
constexpr const decltype(handlerton::flags) HTON_NO_DEFAULT_ENGINE_SUPPORT
Definition: handler.h:3239
std::unordered_set< my_xid, std::hash< my_xid >, std::equal_to< my_xid >, Mem_root_allocator< my_xid > > Xid_commit_list
Single occurrence set of XIDs of internally coordinated transactions found as been committed in the t...
Definition: handler.h:1277
bool(* lock_hton_log_t)(handlerton *hton)
Lock a handlerton (resource) log to collect log information.
Definition: handler.h:2344
Ha_clone_mode
Clone start operation mode.
Definition: handler.h:973
@ HA_CLONE_MODE_ADD_TASK
Add a new task to a running clone operation.
Definition: handler.h:981
@ HA_CLONE_MODE_START
Start a new clone operation.
Definition: handler.h:975
@ HA_CLONE_MODE_MAX
Max value for clone mode.
Definition: handler.h:987
@ HA_CLONE_MODE_VERSION
Get version for transfer data format.
Definition: handler.h:984
@ HA_CLONE_MODE_RESTART
Re-start a clone operation after failure.
Definition: handler.h:978
int(*)(uint64_t *start_id) page_track_start_t
Start page tracking.
Definition: handler.h:2751
static const size_t MAX_FK_NAME_SUFFIX_LENGTH
Maximum possible length of SE-specific suffixes for auto-generated foreign key names.
Definition: handler.h:3330
ha_stat_type
Definition: handler.h:963
@ HA_ENGINE_LOGS
Definition: handler.h:963
@ HA_ENGINE_MUTEX
Definition: handler.h:963
@ HA_ENGINE_STATUS
Definition: handler.h:963
st_plugin_int * remove_hton2plugin(uint slot)
Definition: handler.cc:251
SecondaryEngineGraphSimplificationRequestParameters(*)(THD *thd, const JoinHypergraph &hypergraph, const AccessPath *access_path, int current_subgraph_pairs, int current_subgraph_pairs_limit, bool is_root_access_path, std::string *trace) secondary_engine_check_optimizer_request_t
Hook to evaluate the current hypergraph optimization state in optimization for all the engines,...
Definition: handler.h:2613
static const uint MYSQL_START_TRANS_OPT_WITH_CONS_SNAPSHOT
Options for the START TRANSACTION statement.
Definition: handler.h:648
void(* drop_database_t)(handlerton *hton, const char *db)
Definition: handler.h:1515
int ha_create_table(THD *thd, const char *path, const char *db, const char *table_name, HA_CREATE_INFO *create_info, bool update_create_info, bool is_temp_table, dd::Table *table_def)
Initiates table-file and calls appropriate database-creator.
Definition: handler.cc:5374
std::pair< int, bool > commit_owned_gtids(THD *thd, bool all)
The function computes condition to call gtid persistor wrapper, and executes it.
Definition: handler.cc:1614
int ha_resize_key_cache(KEY_CACHE *key_cache)
Resize key cache.
Definition: handler.cc:5795
std::bitset< HA_CLONE_TYPE_MAX > Ha_clone_flagset
Definition: handler.h:1015
bool ha_log_ddl_create_schema(const char *schema_name)
Call "log_ddl_create_schema" handletron for storage engines who implement it.
Definition: handler.cc:979
bool(*)(THD *thd, LEX *lex) optimize_secondary_engine_t
Optimize a statement for execution on a secondary storage engine.
Definition: handler.h:2403
bool(* notify_alter_table_t)(THD *thd, const MDL_key *mdl_key, ha_notification_type notification_type)
Notify/get permission from storage engine before or after execution of ALTER TABLE operation on the t...
Definition: handler.h:2070
bool(* savepoint_rollback_can_release_mdl_t)(handlerton *hton, THD *thd)
Check if storage engine allows to release metadata locks which were acquired after the savepoint if r...
Definition: handler.h:1409
void(* dict_register_dd_table_id_t)(dd::Object_id hard_coded_tables)
Initialize the set of hard coded DD table ids.
Definition: handler.h:1940
ts_command_type
Definition: handler.h:863
@ CREATE_LOGFILE_GROUP
Definition: handler.h:867
@ DROP_UNDO_TABLESPACE
Definition: handler.h:875
@ TS_CMD_NOT_DEFINED
Definition: handler.h:864
@ ALTER_TABLESPACE
Definition: handler.h:866
@ DROP_LOGFILE_GROUP
Definition: handler.h:870
@ ALTER_ACCESS_MODE_TABLESPACE
Definition: handler.h:872
@ ALTER_UNDO_TABLESPACE
Definition: handler.h:874
@ CHANGE_FILE_TABLESPACE
Definition: handler.h:871
@ DROP_TABLESPACE
Definition: handler.h:869
@ CREATE_UNDO_TABLESPACE
Definition: handler.h:873
@ CREATE_TABLESPACE
Definition: handler.h:865
@ ALTER_LOGFILE_GROUP
Definition: handler.h:868
bool(* is_dict_readonly_t)()
Check if the DDSE is started in a way that leaves thd DD being read only.
Definition: handler.h:1835
constexpr const uint64_t HA_CREATE_USED_VERIFY_KEY_CONSTRAINTS
Definition: handler.h:825
int(* recover_t)(handlerton *hton, XA_recover_txn *xid_list, uint len, MEM_ROOT *mem_root)
Definition: handler.h:1427
bool(* get_table_statistics_t)(const char *db_name, const char *table_name, dd::Object_id se_private_id, const dd::Properties &ts_se_private_data, const dd::Properties &tbl_se_private_data, uint flags, ha_statistics *stats)
Retrieve ha_statistics from SE.
Definition: handler.h:2146
#define HA_MAX_REC_LENGTH
Definition: handler.h:633
#define HTON_SUPPORTS_ATOMIC_DDL
Engine supports atomic DDL.
Definition: handler.h:3193
void(*)(void *arg) se_before_rollback_t
Definition: handler.h:2668
bool(* log_ddl_drop_schema_t)(handlerton *hton, const char *schema_name)
Definition: handler.h:1517
int ha_change_key_cache(KEY_CACHE *old_key_cache, KEY_CACHE *new_key_cache)
Move all tables from one key cache to another one.
Definition: handler.cc:5816
int(* savepoint_release_t)(handlerton *hton, THD *thd, void *sv)
Definition: handler.h:1412
bool(*)(THD *thd) external_engine_explain_check_t
Checks whether the tables used in an explain query are loaded in the secondary engine.
Definition: handler.h:2530
plugin_ref ha_lock_engine(THD *thd, const handlerton *hton)
Definition: handler.cc:527
int(*)(handlerton *hton, THD *thd, const uchar *loc, uint loc_len, uint task_id, int in_err) Clone_apply_end_t
End apply to destination database.
Definition: handler.h:2299
int(* find_files_t)(handlerton *hton, THD *thd, const char *db, const char *path, const char *wild, bool dir, List< LEX_STRING > *files)
Definition: handler.h:1700
bool(* redo_log_set_state_t)(THD *thd, bool enable)
Enable or Disable SE write ahead logging.
Definition: handler.h:2125
void ha_post_recover()
Perform SE-specific cleanup after recovery of transactions.
Definition: handler.cc:9007
void(* acl_notify_t)(THD *thd, const class Acl_change_notification *notice)
Definition: handler.h:1694
constexpr const decltype(handlerton::flags) HTON_SUPPORTS_BULK_LOAD
Definition: handler.h:3231
int(*)(handlerton *hton, THD *thd, const uchar *loc, uint loc_len, uint task_id, int in_err, Ha_clone_cbk *cbk) Clone_apply_t
Apply data to destination database in chunks via callback.
Definition: handler.h:2288
TYPELIB tx_isolation_typelib
Definition: handler.cc:302
handlerton * ha_default_temp_handlerton(THD *thd)
Return the default storage engine handlerton used for explicitly created temp tables for a thread.
Definition: handler.cc:381
bool(* collect_hton_log_info_t)(handlerton *hton, Json_dom *json)
Collect a handlerton (resource) log information.
Definition: handler.h:2356
int(*)(handlerton *hton, THD *thd) set_prepared_in_tc_t
Instructs the storage engine to mark the externally coordinated transactions held by the THD paramete...
Definition: handler.h:1440
void ha_reset_slave(THD *thd)
Definition: handler.cc:6014
void ha_end()
Definition: handler.cc:925
static enum legacy_db_type ha_legacy_type(const handlerton *db_type)
Definition: handler.h:7688
int(*)(handlerton *hton, THD *thd, const uchar *loc, uint loc_len, uint task_id, int in_err) Clone_end_t
End copy from source database.
Definition: handler.h:2261
int ha_release_savepoint(THD *thd, SAVEPOINT *sv)
Definition: handler.cc:2467
static const uint MYSQL_START_TRANS_OPT_READ_WRITE
Definition: handler.h:652
bool ha_log_ddl_drop_schema(const char *schema_name)
Call "log_ddl_drop_schema" handletron for storage engines who implement it.
Definition: handler.cc:958
int(*)(uint64_t *stop_id) page_track_stop_t
Stop page tracking.
Definition: handler.h:2763
bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
Definition: handler.cc:7878
bool(* unlock_hton_log_t)(handlerton *hton)
Unlock a handlerton (resource) log after collecting log information.
Definition: handler.h:2350
constexpr const uint64_t HA_CREATE_USED_ENGINE_ATTRIBUTE
Definition: handler.h:805
constexpr const decltype(handlerton::flags) HTON_SUPPORTS_SQL_FK
Definition: handler.h:3251
int(*)(Page_Track_Callback cbk_func, void *cbk_ctx, uint64_t *start_id, uint64_t *stop_id, unsigned char *buffer, size_t buffer_len) page_track_get_page_ids_t
Fetch tracked pages.
Definition: handler.h:2802
plugin_ref ha_resolve_by_name_raw(THD *thd, const LEX_CSTRING &name)
Resolve handlerton plugin by name, without checking for "DEFAULT" or HTON_NOT_USER_SELECTABLE.
Definition: handler.cc:398
constexpr const decltype(handlerton::flags) HTON_SUPPORTS_DISTANCE_SCAN
Engine supports index distance scan.
Definition: handler.h:3234
void ha_binlog_index_purge_wait(THD *thd)
Request the storage engine to complete any operations that were initiated by ha_binlog_index_purge_fi...
Definition: handler.cc:6030
#define HA_ADMIN_NOT_IMPLEMENTED
Definition: handler.h:185
bool(* is_supported_system_table_t)(const char *db, const char *table_name, bool is_sql_layer_system_table)
Check if the given db.tablename is a system table for this SE.
Definition: handler.h:1741
bool ha_rm_tmp_tables(THD *thd, List< LEX_STRING > *files)
Ask all SEs to drop all temporary tables which have been left from previous server run.
Definition: handler.cc:5719
bool(*)(THD *thd, LEX *lex) prepare_secondary_engine_t
Prepare the secondary engine for executing a statement.
Definition: handler.h:2389
#define HA_CAN_REPAIR
Definition: handler.h:384
bool ha_check_if_supported_system_table(handlerton *hton, const char *db, const char *table_name)
Check if a given table is a system table.
Definition: handler.cc:5599
int ha_commit_attachable(THD *thd)
Commit the attachable transaction in storage engines.
Definition: handler.cc:2230
bool ha_secondary_engine_supports_ddl(THD *thd, const LEX_CSTRING &secondary_engine) noexcept
Definition: handler.cc:448
xa_status_code(*)(handlerton *hton, XID *xid) set_prepared_in_tc_by_xid_t
Instructs the storage engine to mark the externally coordinated transactions identified by the XID pa...
Definition: handler.h:1500
int(* close_connection_t)(handlerton *hton, THD *thd)
close_connection is only called if thd->ha_data[xxx_hton.slot] is non-zero, so even if you don't need...
Definition: handler.h:1373
const char * tx_isolation_names[]
Definition: handler.cc:300
int check_table_for_old_types(const TABLE *table)
Function identifies any old data type present in table.
Definition: handler.cc:4721
TYPELIB * ha_known_exts()
Definition: handler.cc:7833
bool(* sdi_create_t)(dd::Tablespace *tablespace)
Create SDI in a tablespace.
Definition: handler.h:1752
bool(* dict_init_t)(dict_init_mode_t dict_init_mode, uint version, List< const Plugin_table > *DDSE_tables, List< const Plugin_tablespace > *DDSE_tablespaces)
Initialize the SE for being used to store the DD tables.
Definition: handler.h:1928
int(* panic_t)(handlerton *hton, enum ha_panic_function flag)
Definition: handler.h:1523
constexpr const uint64_t HA_CREATE_USED_SECONDARY_ENGINE_ATTRIBUTE
Definition: handler.h:806
static bool ha_check_storage_engine_flag(const handlerton *db_type, uint32 flag)
Definition: handler.h:7694
int ha_prepare_low(THD *thd, bool all)
Prepares the underlying transaction of the THD session object parameter in the storage engines that p...
Definition: handler.cc:2380
ha_ddl_type
Definition: handler.h:965
@ HA_TRUNCATE_DDL
Definition: handler.h:968
@ HA_INVALID_DDL
Definition: handler.h:966
@ HA_ALTER_DDL
Definition: handler.h:967
@ HA_RENAME_DDL
Definition: handler.h:969
int ha_init_key_cache(std::string_view name, KEY_CACHE *key_cache)
Init a key cache if it has not been initied before.
Definition: handler.cc:5776
uint64_t SecondaryEngineFlags
Definition: handler.h:2616
int(* finish_upgrade_t)(THD *thd, bool failed_upgrade)
Finish upgrade process inside storage engines.
Definition: handler.h:1634
void(*)(std::vector< std::pair< uint64_t, bool > > &status) page_track_get_status_t
Fetch the status of the page tracking system.
Definition: handler.h:2829
bool(* rm_tmp_tables_t)(handlerton *hton, THD *thd, List< LEX_STRING > *files)
Drop all temporary tables which have been left from previous server run belonging to this SE.
Definition: handler.h:1850
static const uint32 HTON_FKS_WITH_SUPPORTING_HASH_KEYS
Storage engine supports hash keys as supporting keys for foreign keys.
Definition: handler.h:3293
static const uint MYSQL_START_TRANS_OPT_HIGH_PRIORITY
Definition: handler.h:654
int ha_binlog_index_purge_file(THD *thd, const char *file)
Inform storage engine(s) that a binary log file will be purged and any references to it should be rem...
Definition: handler.cc:6024
#define HTON_SECONDARY_ENGINE_SUPPORTS_DDL
Whether the secondary engine supports DDLs.
Definition: handler.h:3218
bool(* get_index_column_cardinality_t)(const char *db_name, const char *table_name, const char *index_name, uint index_ordinal_position, uint column_ordinal_position, dd::Object_id se_private_id, ulonglong *cardinality)
Retrieve index column cardinality from SE.
Definition: handler.h:2185
bool(*)(const SecondaryEngineNrowsParameters ¶ms) secondary_engine_nrows_t
Type for signature generation and for retrieving nrows estimate from secondary engine for current Acc...
Definition: handler.h:2520
bool default_rm_tmp_tables(handlerton *hton, THD *thd, List< LEX_STRING > *files)
Default implementation for handlerton::rm_tmp_tables() method which simply removes all files from "fi...
Definition: handler.cc:5731
enum_alter_inplace_result
Return values for check_if_supported_inplace_alter().
Definition: handler.h:207
@ HA_ALTER_INPLACE_NOT_SUPPORTED
Definition: handler.h:209
@ HA_ALTER_INPLACE_NO_LOCK_AFTER_PREPARE
Definition: handler.h:213
@ HA_ALTER_INPLACE_INSTANT
Definition: handler.h:215
@ HA_ALTER_INPLACE_SHARED_LOCK
Definition: handler.h:212
@ HA_ALTER_INPLACE_NO_LOCK
Definition: handler.h:214
@ HA_ALTER_INPLACE_EXCLUSIVE_LOCK
Definition: handler.h:210
@ HA_ALTER_ERROR
Definition: handler.h:208
@ HA_ALTER_INPLACE_SHARED_LOCK_AFTER_PREPARE
Definition: handler.h:211
constexpr const decltype(handlerton::flags) HTON_SUPPORTS_ENGINE_ATTRIBUTE
Definition: handler.h:3207
bool Log_func(THD *, TABLE *, bool, const uchar *, const uchar *)
Definition: handler.h:7779
bool hton_is_secondary_engine(const handlerton *hton)
Definition: handler.h:3246
void(*)(struct HA_CREATE_INFO *create_info, const char *db, const char *table_name) notify_create_table_t
Notify plugins when a table is created.
Definition: handler.h:2685
static const uint MYSQL_START_TRANS_OPT_READ_ONLY
Definition: handler.h:650
void(* kill_connection_t)(handlerton *hton, THD *thd)
Terminate connection/statement notification.
Definition: handler.h:1376
uint calculate_key_len(TABLE *table, uint key, key_part_map keypart_map)
Calculates length of key.
Definition: handler.cc:7787
int(* prepare_t)(handlerton *hton, THD *thd, bool all)
Definition: handler.h:1425
bool(* sdi_drop_t)(dd::Tablespace *tablespace)
Drop SDI in a tablespace.
Definition: handler.h:1761
void print_keydup_error(TABLE *table, KEY *key, const char *msg, myf errflag, const char *org_table_name)
Construct and emit duplicate key error message using information from table's record buffer.
Definition: handler.cc:4227
int ha_init(void)
Definition: handler.cc:910
int(* alter_tablespace_t)(handlerton *hton, THD *thd, st_alter_tablespace *ts_info, const dd::Tablespace *old_ts_def, dd::Tablespace *new_ts_def)
Create/drop or alter tablespace in the storage engine.
Definition: handler.h:1583
int ha_enable_transaction(THD *thd, bool on)
Tell the storage engine that it is allowed to "disable transaction" in the handler.
Definition: handler.cc:5285
bool secondary_engine_supports_ddl(const handlerton *hton)
Definition: handler.h:3255
Ha_clone_type
Clone operation types.
Definition: handler.h:991
@ HA_CLONE_BLOCKING
Caller must block all write operation to the SE.
Definition: handler.h:993
@ HA_CLONE_RESTART
SE supports restarting clone after network failure.
Definition: handler.h:1009
@ HA_CLONE_HYBRID
For transactional SE, use both page tracking and redo to optimize clone with concurrent dml.
Definition: handler.h:1003
@ HA_CLONE_MULTI_TASK
SE supports multiple threads for clone.
Definition: handler.h:1006
@ HA_CLONE_TYPE_MAX
Maximum value of clone type.
Definition: handler.h:1012
@ HA_CLONE_PAGE
For transactional SE, track page changes to support concurrent dml.
Definition: handler.h:999
@ HA_CLONE_REDO
For transactional SE, archive redo to support concurrent dml.
Definition: handler.h:996
enum_schema_tables
Definition: handler.h:946
@ SCH_OPTIMIZER_TRACE
Definition: handler.h:951
@ SCH_ENGINES
Definition: handler.h:949
@ SCH_TABLE_PRIVILEGES
Definition: handler.h:956
@ SCH_COLUMN_PRIVILEGES
Definition: handler.h:948
@ SCH_SCHEMA_PRIVILEGES
Definition: handler.h:955
@ SCH_PLUGINS
Definition: handler.h:952
@ SCH_PROFILES
Definition: handler.h:954
@ SCH_LAST
Definition: handler.h:960
@ SCH_TMP_TABLE_KEYS
Definition: handler.h:959
@ SCH_USER_PRIVILEGES
Definition: handler.h:957
@ SCH_PROCESSLIST
Definition: handler.h:953
@ SCH_OPEN_TABLES
Definition: handler.h:950
@ SCH_TMP_TABLE_COLUMNS
Definition: handler.h:958
@ SCH_FIRST
Definition: handler.h:947
constexpr const uint64_t HA_CREATE_USED_AUTOEXTEND_SIZE
These flags convey that the options AUTOEXTEND_SIZE has been specified in the CREATE TABLE statement.
Definition: handler.h:819
bool(* get_tablespace_type_by_name_t)(const char *tablespace_name, Tablespace_type *space_type)
Get the tablespace type given the name, from the SE.
Definition: handler.h:1680
bool ha_check_if_table_exists(THD *thd, const char *db, const char *name, bool *exists)
Try to find a table in a storage engine.
Definition: handler.cc:5536
void(*)(void *arg) se_after_commit_t
Definition: handler.h:2664
std::vector< sdi_key_t > sdi_container
Definition: handler.h:143
st_plugin_int * hton2plugin(uint slot)
Maps from slot to plugin. May return NULL if plugin has been unloaded.
Definition: handler.cc:241
st_plugin_int * insert_hton2plugin(uint slot, st_plugin_int *plugin)
For unit testing.
Definition: handler.cc:245
SecondaryEngineFlag
Definition: handler.h:2617
@ USE_EXTERNAL_EXECUTOR
This flag can be set to signal that a secondary storage engine will not use MySQL's executor (see JOI...
@ SUPPORTS_NESTED_LOOP_JOIN
@ AGGREGATION_IS_UNORDERED
void ha_pre_dd_shutdown(void)
Invoke handlerton::pre_dd_shutdown() on every storage engine plugin.
Definition: handler.cc:1057
void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted, Cost_estimate *cost)
Get cost of reading nrows table records in a "disk sweep".
Definition: handler.cc:7425
plugin_ref ha_default_temp_plugin(THD *thd)
Definition: handler.cc:363
constexpr const decltype(handlerton::flags) HTON_SUPPORTS_GENERATED_INVISIBLE_PK
Engine supports Generated invisible primary key.
Definition: handler.h:3213
bool(* get_tablespace_type_t)(const dd::Tablespace &space, Tablespace_type *space_type)
Get the tablespace type from the SE.
Definition: handler.h:1668
bool(* rotate_encryption_master_key_t)(void)
Initiate master key rotation.
Definition: handler.h:2114
void(* post_recover_t)(void)
Perform SE-specific cleanup after recovery of transactions.
Definition: handler.h:2338
bool(* notify_rename_table_t)(THD *thd, const MDL_key *mdl_key, ha_notification_type notification_type, const char *old_db_name, const char *old_table_name, const char *new_db_name, const char *new_table_name)
Notify/get permission from storage engine before or after execution of RENAME TABLE operation on the ...
Definition: handler.h:2087
int ha_commit_trans(THD *thd, bool all, bool ignore_global_read_lock=false)
Definition: handler.cc:1686
#define HTON_IS_SECONDARY_ENGINE
Engine is a secondary storage engine.
Definition: handler.h:3199
int(* start_consistent_snapshot_t)(handlerton *hton, THD *thd)
Definition: handler.h:1525
enum_stats_auto_recalc
Definition: handler.h:3347
@ HA_STATS_AUTO_RECALC_DEFAULT
Definition: handler.h:3348
@ HA_STATS_AUTO_RECALC_OFF
Definition: handler.h:3350
@ HA_STATS_AUTO_RECALC_ON
Definition: handler.h:3349
const char *(* get_tablespace_filename_ext_t)()
SE interface for getting tablespace extension.
Definition: handler.h:1592
ts_alter_tablespace_type
Definition: handler.h:878
@ TS_ALTER_TABLESPACE_TYPE_NOT_DEFINED
Definition: handler.h:879
@ ALTER_UNDO_TABLESPACE_SET_ACTIVE
Definition: handler.h:884
@ ALTER_UNDO_TABLESPACE_SET_INACTIVE
Definition: handler.h:885
@ ALTER_TABLESPACE_OPTIONS
Definition: handler.h:883
@ ALTER_TABLESPACE_DROP_FILE
Definition: handler.h:881
@ ALTER_TABLESPACE_RENAME
Definition: handler.h:882
@ ALTER_TABLESPACE_ADD_FILE
Definition: handler.h:880
void(* binlog_log_query_t)(handlerton *hton, THD *thd, enum_binlog_command binlog_command, const char *query, uint query_length, const char *db, const char *table_name)
Definition: handler.h:1689
xa_status_code(* commit_by_xid_t)(handlerton *hton, XID *xid)
Definition: handler.h:1490
bool is_index_access_error(int error)
Check whether an error is index access error or not after an index read.
Definition: handler.cc:9118
plugin_ref ha_resolve_by_name(THD *thd, const LEX_CSTRING *name, bool is_temp_table)
Return the storage engine handlerton for the supplied name.
Definition: handler.cc:413
void(* replace_native_transaction_in_thd_t)(THD *thd, void *new_trx_arg, void **ptr_trx_arg)
Definition: handler.h:1892
constexpr const uint64_t HA_CREATE_USED_READ_ONLY
ALTER SCHEMA|DATABASE has an explicit READ_ONLY clause.
Definition: handler.h:813
bool(*)(THD *thd, std::string_view db_name, std::string_view table_name, std::string_view view_def) notify_materialized_view_usage_t
Notify plugins when a materialized view is referenced in a query.
Definition: handler.h:2702
constexpr const uint64_t HA_CREATE_USED_EXPLICIT_ENGINE
These flags indicate that ENGINE/SECONDARY_ENGINE were set explicitly (not by EXTERNAL keyword defaul...
Definition: handler.h:834
bool(* sdi_delete_t)(const dd::Tablespace &tablespace, const dd::Table *table, const sdi_key_t *sdi_key)
Delete SDI for a given SDI key.
Definition: handler.h:1826
std::string_view(*)(THD *thd) find_secondary_engine_offload_fail_reason_t
Finds and returns a specific secondary engine query offload failure reason as a string given a thread...
Definition: handler.h:2556
bool(* get_tablespace_statistics_t)(const char *tablespace_name, const char *file_name, const dd::Properties &ts_se_private_data, ha_tablespace_statistics *stats)
Retrieve ha_tablespace_statistics from SE.
Definition: handler.h:2205
SecondaryEngineGraphSimplificationRequest
Definition: handler.h:2572
@ kRestart
Trigger restart of hypergraph with provided number of subgraph pairs.
@ kContinue
Continue optimization phase with current hypergraph.
int(* discover_t)(handlerton *hton, THD *thd, const char *db, const char *name, uchar **frmblob, size_t *frmlen)
Definition: handler.h:1697
ulong total_ha_2pc
Definition: handler.cc:271
int(* table_exists_in_engine_t)(handlerton *hton, THD *thd, const char *db, const char *name)
Definition: handler.h:1704
enum_binlog_command
Definition: handler.h:713
@ LOGCOM_DROP_TABLE
Definition: handler.h:717
@ LOGCOM_CREATE_DB
Definition: handler.h:718
@ LOGCOM_DROP_DB
Definition: handler.h:720
@ LOGCOM_RENAME_TABLE
Definition: handler.h:716
@ LOGCOM_ALTER_TABLE
Definition: handler.h:715
@ LOGCOM_ALTER_DB
Definition: handler.h:719
@ LOGCOM_CREATE_TABLE
Definition: handler.h:714
static const uint32 HTON_FKS_NEED_DIFFERENT_PARENT_AND_SUPPORTING_KEYS
Storage engine does not support using the same key for both parent and supporting key,...
Definition: handler.h:3313
bool set_tx_isolation(THD *thd, enum_tx_isolation tx_isolation, bool one_shot)
Set the transaction isolation level for the next transaction and update session tracker information a...
Definition: handler.cc:8962
bool ha_is_storage_engine_disabled(handlerton *se_engine)
Definition: handler.cc:522
const char * ha_row_type[]
Definition: handler.cc:289
bool ha_notify_table_ddl(THD *thd, const MDL_key *mdl_key, ha_notification_type notification_type, ha_ddl_type ddl_type, const char *old_db_name, const char *old_table_name, const char *new_db_name, const char *new_table_name)
Notify/get permission from all interested storage engines before or after executed DDL (ALTER TABLE,...
Definition: handler.cc:8930
handlerton * ha_resolve_by_legacy_type(THD *thd, enum legacy_db_type db_type)
Definition: handler.cc:558
std::string_view(*)(const THD *thd) get_secondary_engine_offload_or_exec_fail_reason_t
Looks up and returns a specific secondary engine query offload or exec failure reason as a string giv...
Definition: handler.h:2544
std::optional< ha_column_statistics >(* get_column_statistics_t)(THD *thd, const char *db_name, const char *table_name, const char *column_name, double rows_in_table)
Retrieve column_statistics from SE.
Definition: handler.h:2162
handler * get_new_handler(TABLE_SHARE *share, bool partitioned, MEM_ROOT *alloc, handlerton *db_type)
Create handler object for the table in the storage engine.
Definition: handler.cc:614
std::atomic< const char * > default_secondary_engine_name
Store the name of default secondary engine, if any.
Definition: handler.cc:9025
#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
Definition: handler.h:304
enum_tx_isolation
Definition: handler.h:3340
@ ISO_READ_UNCOMMITTED
Definition: handler.h:3341
@ ISO_REPEATABLE_READ
Definition: handler.h:3343
@ ISO_READ_COMMITTED
Definition: handler.h:3342
@ ISO_SERIALIZABLE
Definition: handler.h:3344
bool(* notify_truncate_table_t)(THD *thd, const MDL_key *mdl_key, ha_notification_type notification_type)
Notify/get permission from storage engine before or after execution of TRUNCATE TABLE operation on th...
Definition: handler.h:2104
void(* pre_dd_shutdown_t)(handlerton *hton)
Shut down all storage engine background tasks that might access the data dictionary,...
Definition: handler.h:1382
const char * ha_resolve_storage_engine_name(const handlerton *db_type)
Definition: handler.cc:258
bool(* flush_logs_t)(handlerton *hton, bool binlog_group_flush)
Flush the log(s) of storage engine(s).
Definition: handler.h:1536
bool ha_check_reserved_db_name(const char *name)
Check if the database name is reserved word used by SE.
Definition: handler.cc:9101
const char * table_case_name(const HA_CREATE_INFO *info, const char *name)
Definition: handler.cc:4210
const char * get_canonical_filename(handler *file, const char *path, char *tmp_path)
make canonical filename
Definition: handler.cc:2562
bool can_use_index_statistics(const TABLE *table, uint keyno, uint range_flag, key_part_map keypart_map, int *keyparts_used)
Check if index statistics can be used for an equality range.
Definition: handler.cc:9122
bool(* dict_set_server_version_t)()
Store the current server version number into the header of the dictionary tablespace.
Definition: handler.h:2005
bool(* log_ddl_create_schema_t)(handlerton *hton, const char *schema_name)
Definition: handler.h:1520
int ha_rollback_to_savepoint(THD *thd, SAVEPOINT *sv)
Definition: handler.cc:2316
int(*)(THD *thd, AccessPath *query, JOIN *join) push_to_engine_t
Let storage engine inspect the query Accesspath and pick whatever it like for being pushed down to th...
Definition: handler.h:1724
int ha_panic(enum ha_panic_function flag)
int(* commit_t)(handlerton *hton, THD *thd, bool all)
'all' is true if it's a real commit, that makes persistent changes 'all' is false if it's not in fact...
Definition: handler.h:1421
int ha_recover(Xid_commit_list *commit_list=nullptr, Xa_state_list *xa_state_list=nullptr)
Stage of the recovery process where information is collected from the storage engines (SE),...
Definition: xa.cc:270
int ha_delete_table(THD *thd, handlerton *db_type, const char *path, const char *db, const char *alias, const dd::Table *table_def, bool generate_warning)
Delete table from the storage engine.
Definition: handler.cc:2609
constexpr const decltype(handlerton::flags) HTON_SECONDARY_SUPPORTS_TEMPORARY_TABLE(1<< 25)
Whether the secondary engine supports creation of temporary tables.
static const uint32 HTON_FKS_WITH_EXTENDED_PARENT_KEYS
Engine takes into account hidden part of key (coming from primary key) when determines if it can serv...
Definition: handler.h:3324
row_type
Definition: handler.h:692
@ ROW_TYPE_COMPRESSED
Definition: handler.h:697
@ ROW_TYPE_REDUNDANT
Definition: handler.h:698
@ ROW_TYPE_NOT_USED
Definition: handler.h:693
@ ROW_TYPE_FIXED
Definition: handler.h:695
@ ROW_TYPE_PAGED
Unused.
Definition: handler.h:701
@ ROW_TYPE_DEFAULT
Definition: handler.h:694
@ ROW_TYPE_COMPACT
Definition: handler.h:699
@ ROW_TYPE_DYNAMIC
Definition: handler.h:696
bool() stat_print_fn(THD *thd, const char *type, size_t type_len, const char *file, size_t file_len, const char *status, size_t status_len)
Definition: handler.h:151
void ha_drop_database(const char *schema_name)
Call the "drop_database_t" handlerton API for storage engines that implemented it to drop the databas...
Definition: handler.cc:939
const handlerton * SecondaryEngineHandlerton(const THD *thd)
Returns the handlerton of the secondary engine that is used in the session, or nullptr if a secondary...
Definition: handler.cc:9018
static const LEX_CSTRING FK_NAME_DEFAULT_SUFFIX
Suffix for auto-generated foreign key names for tables in SE's which don't specify own suffix.
Definition: handler.h:3338
handlerton * ha_default_handlerton(THD *thd)
Return the default storage engine handlerton used for non-temp tables for thread.
Definition: handler.cc:355
int ha_savepoint(THD *thd, SAVEPOINT *sv)
Definition: handler.cc:2424
void(*)(THD *thd, SelectExecutedIn executed_in) notify_after_select_t
Notify plugins when a SELECT query was executed.
Definition: handler.h:2679
void ha_close_connection(THD *thd)
Definition: handler.cc:1014
int(*)(handlerton *hton, THD *thd, const uchar *&loc, uint &loc_len, uint &task_id, Ha_clone_type type, Ha_clone_mode mode) Clone_begin_t
Begin copy from source database.
Definition: handler.h:2226
int(* upgrade_logs_t)(THD *thd)
Upgrade logs after the checkpoint from where upgrade process can only roll forward.
Definition: handler.h:1648
bool(* is_reserved_db_name_t)(handlerton *hton, const char *name)
Definition: handler.h:2375
int(* savepoint_rollback_t)(handlerton *hton, THD *thd, void *sv)
sv points to a storage area, that was earlier passed to the savepoint_set call
Definition: handler.h:1395
void(*)(Ha_clone_flagset &flags) Clone_capability_t
Get capability flags for clone operation.
Definition: handler.h:2213
int ha_binlog_end(THD *thd)
Definition: handler.cc:6076
bool(*)(THD *thd) secondary_engine_pre_prepare_hook_t
Secondary engine hook called after PRIMARY_TENTATIVELY optimization is complete, and decides if secon...
Definition: handler.h:2715
constexpr const uint64_t HA_CREATE_USED_FILE_FORMAT
Table options for external tables.
Definition: handler.h:822
void(*)(Table_ref *tab) notify_drop_table_t
Notify plugins when a table is dropped.
Definition: handler.h:2730
const char * binlog_format_names[]
Definition: mysqld.cc:1355
constexpr const uint64_t HA_CREATE_USED_START_TRANSACTION
This option is used to convey that the create table should not commit the operation and keep the tran...
Definition: handler.h:803
int(*)(uint64_t *start_id, uint64_t *stop_id, uint64_t *num_pages) page_track_get_num_page_ids_t
Fetch approximate number of tracked pages in the given range.
Definition: handler.h:2823
int(*)(handlerton *hton, THD *thd, const uchar *loc, uint loc_len, uint task_id, Ha_clone_cbk *cbk) Clone_copy_t
Copy data from source database in chunks via callback.
Definition: handler.h:2237
xa_status_code
X/Open XA distributed transaction status codes.
Definition: handler.h:1443
@ XAER_ASYNC
asynchronous operation already outstanding
Definition: handler.h:1452
@ XAER_PROTO
routine invoked in an improper context
Definition: handler.h:1472
@ XAER_INVAL
invalid arguments were given
Definition: handler.h:1467
@ XAER_NOTA
the XID is not valid
Definition: handler.h:1462
@ XAER_OUTSIDE
resource manager doing work outside transaction
Definition: handler.h:1487
@ XAER_RMFAIL
resource manager unavailable
Definition: handler.h:1477
@ XA_OK
normal execution
Definition: handler.h:1447
@ XAER_DUPID
the XID already exists
Definition: handler.h:1482
@ XAER_RMERR
a resource manager error occurred in the transaction branch
Definition: handler.h:1457
void ha_binlog_wait(THD *thd)
Definition: handler.cc:6019
constexpr const uint64_t HA_CREATE_USED_ALLOW_MISSING_FILES
Definition: handler.h:824
bool(* dict_get_server_version_t)(uint *version)
Get the server version id stored in the header of the dictionary tablespace.
Definition: handler.h:1997
void ha_reset_plugin_vars(THD *thd)
Definition: handler.cc:1005
int ha_start_consistent_snapshot(THD *thd)
Definition: handler.cc:2508
constexpr const uint32 SDI_TYPE_TABLESPACE
Id for identifying Tablespace SDIs.
Definition: handler.h:132
int(*)(handlerton *hton, THD *thd, const uchar *loc, uint loc_len, uint task_id, int in_err, Ha_clone_cbk *cbk) Clone_ack_t
Acknowledge data transfer to source database.
Definition: handler.h:2250
bool(*)(THD *thd, const JoinHypergraph &hypergraph, AccessPath *access_path) secondary_engine_modify_view_ap_cost_t
Evaluates/Views the cost of executing the given access path in the secondary storage engine,...
Definition: handler.h:2480
bool(* is_valid_tablespace_name_t)(ts_command_type ts_cmd, const char *tablespace_name)
SE specific validation of the tablespace name.
Definition: handler.h:1562
int ha_table_exists_in_engine(THD *thd, const char *db, const char *name)
Definition: handler.cc:5950
constexpr const uint64_t HA_CREATE_USED_EXPLICIT_SECONDARY_ENGINE
Definition: handler.h:835
int(* upgrade_tablespace_t)(THD *thd)
Get the tablespace data from SE and insert it into Data dictionary.
Definition: handler.h:1605
bool(* notify_exclusive_mdl_t)(THD *thd, const MDL_key *mdl_key, ha_notification_type notification_type, bool *victimized)
Notify/get permission from storage engine before acquisition or after release of exclusive metadata l...
Definition: handler.h:2038
int ha_commit_low(THD *thd, bool all, bool run_after_commit=true)
Commit the sessions outstanding transaction.
Definition: handler.cc:1959
uint(* partition_flags_t)()
The flag values are defined in sql_partition.h.
Definition: handler.h:1548
bool ha_flush_logs(bool binlog_group_flush=false)
Flush the log(s) of storage engine(s).
Definition: handler.cc:2532
dict_recovery_mode_t
Mode for data dictionary recovery.
Definition: handler.h:1964
@ DICT_RECOVERY_RESTART_SERVER
Restart of an existing server.
Definition: handler.h:1967
@ DICT_RECOVERY_INITIALIZE_TABLESPACES
First start, create tablespaces.
Definition: handler.h:1966
@ DICT_RECOVERY_INITIALIZE_SERVER
First start of a new server.
Definition: handler.h:1965
bool(* sdi_get_keys_t)(const dd::Tablespace &tablespace, sdi_vector_t &vector)
Get the SDI keys in a tablespace into vector.
Definition: handler.h:1770
ulong savepoint_alloc_size
Definition: handler.cc:273
int(* fill_is_table_t)(handlerton *hton, THD *thd, Table_ref *tables, class Item *cond, enum enum_schema_tables)
Definition: handler.h:1683
int(* binlog_func_t)(handlerton *hton, THD *thd, enum_binlog_func fn, void *arg)
Definition: handler.h:1686
int ha_create_table_from_engine(THD *thd, const char *db, const char *name)
Try to discover table from engine.
Definition: handler.cc:5456
enum_binlog_func
Definition: handler.h:704
@ BFN_BINLOG_WAIT
Definition: handler.h:707
@ BFN_BINLOG_PURGE_WAIT
Definition: handler.h:710
@ BFN_BINLOG_END
Definition: handler.h:708
@ BFN_RESET_SLAVE
Definition: handler.h:706
@ BFN_BINLOG_PURGE_FILE
Definition: handler.h:709
@ BFN_RESET_LOGS
Definition: handler.h:705
constexpr const uint64_t HA_CREATE_USED_STRICT_LOAD
Definition: handler.h:826
void set_externally_disabled_storage_engine_names(const char *)
Read a comma-separated list of storage engine names.
Definition: handler.cc:471
void(*)(void *arg) se_before_commit_t
Definition: handler.h:2660
int(* rollback_t)(handlerton *hton, THD *thd, bool all)
Definition: handler.h:1423
void(* dict_cache_reset_t)(const char *schema_name, const char *table_name)
Invalidate an entry in the local dictionary cache.
Definition: handler.h:1952
bool ha_rollback_to_savepoint_can_release_mdl(THD *thd)
Check if all storage engines used in transaction agree that after rollback to savepoint it is safe to...
Definition: handler.cc:2293
int binlog_log_row(TABLE *table, const uchar *before_record, const uchar *after_record, Log_func *log_func)
Definition: handler.cc:8063
void * range_seq_t
Definition: handler.h:3985
int ha_init_errors(void)
Register handler error messages for use with my_error().
Definition: handler.cc:649
bool(*)(THD *thd, const JOIN &join, double optimizer_cost, bool *use_best_so_far, bool *cheaper, double *secondary_engine_cost) compare_secondary_engine_cost_t
Compares the cost of two join plans in the secondary storage engine.
Definition: handler.h:2426
handlerton * get_default_handlerton(THD *thd, handlerton *hton)
Get default handlerton, if handler supplied is null.
Definition: handler.h:7680
int ha_rollback_trans(THD *thd, bool all)
Definition: handler.cc:2129
constexpr const ha_rows EXTRA_RECORDS
Definition: handler.h:126
void(*)(THD *thd, JoinHypergraph *graph) cardinality_estimation_hook_t
Hook used to estimate the cardinality of table Node objects in the JoinHypergraph.
Definition: handler.h:2725
enum_sampling_method
Definition: handler.h:723
int ha_reset_logs(THD *thd)
Definition: handler.cc:6008
bool ha_storage_engine_is_enabled(const handlerton *db_type)
Predicate to determine if a storage engine, represented by a handlerton*, is enabled.
Definition: handler.h:7708
dict_init_mode_t
Mode for initializing the data dictionary.
Definition: handler.h:1896
@ DICT_INIT_CREATE_FILES
Create all required SE files.
Definition: handler.h:1897
@ DICT_INIT_CHECK_FILES
Verify existence of expected files.
Definition: handler.h:1898
bool(* check_fk_column_compat_t)(const Ha_fk_column_type *child_column_type, const Ha_fk_column_type *parent_column_type, bool check_charsets)
Check SE considers types of child and parent columns in foreign key to be compatible.
Definition: handler.h:2371
constexpr SecondaryEngineFlags MakeSecondaryEngineFlags()
Creates an empty bitmap of access path types.
Definition: handler.h:2637
bool ha_is_externally_disabled(const handlerton &)
Returns true if the storage engine of the handlerton argument has been listed in the disabled_storage...
Definition: handler.cc:515
int(*)(handlerton *hton, Xa_state_list &xa_list) recover_prepared_in_tc_t
Retrieves information about externally coordinated transactions for which the two-phase prepare was f...
Definition: handler.h:1435
constexpr const uint64_t HA_CREATE_USED_AUTO_REFRESH
Definition: handler.h:827
static const uint32 HTON_FKS_WITH_PREFIX_PARENT_KEYS
Engine supports both unique and non-unique parent keys for foreign keys which contain full foreign ke...
Definition: handler.h:3282
bool secondary_engine_supports_temporary_tables(const handlerton *hton)
Definition: handler.h:3261
void(* dict_cache_reset_tables_and_tablespaces_t)()
Invalidate all table and tablespace entries in the local dictionary cache.
Definition: handler.h:1961
#define HA_NO_TRANSACTIONS
Definition: handler.h:225
void(* post_ddl_t)(THD *thd)
Perform post-commit/rollback cleanup after DDL statement (e.g.
Definition: handler.h:2329
bool ddl_is_atomic(const handlerton *hton)
Definition: handler.h:3266
const handlerton * EligibleSecondaryEngineHandlerton(THD *thd, const LEX_CSTRING *secondary_engine_in_name)
Returns the handlerton of the eligible secondary engine that is used in the session,...
Definition: handler.cc:9036
ulonglong my_xid
Definition: handler.h:1259
legacy_db_type
Definition: handler.h:656
@ DB_TYPE_MARIA
Definition: handler.h:684
@ DB_TYPE_FEDERATED_DB
Definition: handler.h:675
@ DB_TYPE_GEMINI
Definition: handler.h:670
@ DB_TYPE_FIRST_DYNAMIC
Definition: handler.h:688
@ DB_TYPE_MISAM
Definition: handler.h:660
@ DB_TYPE_HEAP
Definition: handler.h:663
@ DB_TYPE_TABLE_FUNCTION
Definition: handler.h:681
@ DB_TYPE_DIAB_ISAM
Definition: handler.h:658
@ DB_TYPE_TEMPTABLE
Definition: handler.h:687
@ DB_TYPE_HASH
Definition: handler.h:659
@ DB_TYPE_PARTITION_DB
Definition: handler.h:677
@ DB_TYPE_BINLOG
Definition: handler.h:678
@ DB_TYPE_SOLID
Definition: handler.h:679
@ DB_TYPE_UNKNOWN
Definition: handler.h:657
@ DB_TYPE_ISAM
Definition: handler.h:664
@ DB_TYPE_MRG_MYISAM
Definition: handler.h:667
@ DB_TYPE_PERFORMANCE_SCHEMA
Performance schema engine.
Definition: handler.h:686
@ DB_TYPE_EXAMPLE_DB
Definition: handler.h:672
@ DB_TYPE_CSV_DB
Definition: handler.h:674
@ DB_TYPE_NDBCLUSTER
Definition: handler.h:671
@ DB_TYPE_INNODB
Definition: handler.h:669
@ DB_TYPE_FALCON
Definition: handler.h:683
@ DB_TYPE_DEFAULT
Definition: handler.h:689
@ DB_TYPE_BLACKHOLE_DB
Definition: handler.h:676
@ DB_TYPE_MYISAM
Definition: handler.h:666
@ DB_TYPE_RMS_ISAM
Definition: handler.h:662
@ DB_TYPE_BERKELEY_DB
Definition: handler.h:668
@ DB_TYPE_MRG_ISAM
Definition: handler.h:665
@ DB_TYPE_PBXT
Definition: handler.h:680
@ DB_TYPE_PISAM
Definition: handler.h:661
@ DB_TYPE_ARCHIVE_DB
Definition: handler.h:673
@ DB_TYPE_MEMCACHE
Definition: handler.h:682
int ha_initialize_handlerton(st_plugin_int *plugin)
Definition: handler.cc:784
ha_notification_type
Definition: handler.h:964
@ HA_NOTIFY_POST_EVENT
Definition: handler.h:964
@ HA_NOTIFY_PRE_EVENT
Definition: handler.h:964
bool(* upgrade_space_version_t)(dd::Tablespace *tablespace)
Get the tablespace data from SE and insert it into Data dictionary.
Definition: handler.h:1618
Tablespace_type
Definition: handler.h:1650
xa_status_code(* rollback_by_xid_t)(handlerton *hton, XID *xid)
Definition: handler.h:1492
SelectExecutedIn
Used to identify which engine executed a SELECT query.
Definition: handler.h:221
constexpr const uint64_t HA_CREATE_USED_AUTO_REFRESH_SOURCE
Definition: handler.h:828
void ha_binlog_log_query(THD *thd, handlerton *db_type, enum_binlog_command binlog_command, const char *query, size_t query_length, const char *db, const char *table_name)
Definition: handler.cc:6059
handler *(* create_t)(handlerton *hton, TABLE_SHARE *table, bool partitioned, MEM_ROOT *mem_root)
Create handler object for the table in the storage engine.
Definition: handler.h:1512
void ha_acl_notify(THD *thd, class Acl_change_notification *)
Definition: handler.cc:6090
SE_cost_constants *(* get_cost_constants_t)(uint storage_category)
Retrieve cost constants to be used for this storage engine.
Definition: handler.h:1877
static bool commit(THD *thd)
Commit the current statement and transaction.
Definition: sql_cmd_srs.cc:152
File containing constants that can be used throughout the server.
SHOW_COMP_OPTION
Definition: sql_const.h:230
@ SHOW_OPTION_YES
Definition: sql_const.h:230
constexpr const unsigned int MAX_KEY
Definition: sql_const.h:45
constexpr const unsigned int MAX_REF_PARTS
Definition: sql_const.h:46
constexpr const unsigned int MAX_KEY_LENGTH
Definition: sql_const.h:47
case opt name
Definition: sslopt-case.h:29
#define STRING_WITH_LEN(X)
Definition: string_with_len.h:29
Access paths are a query planning structure that correspond 1:1 to iterators, in that an access path ...
Definition: access_path.h:243
Callbacks for collecting time statistics.
Definition: bulk_data_service.h:931
Definition: m_ctype.h:421
Definition: handler.h:2301
Clone_apply_t clone_apply
Definition: handler.h:2313
Clone_end_t clone_end
Definition: handler.h:2309
Clone_capability_t clone_capability
Definition: handler.h:2303
Clone_apply_begin_t clone_apply_begin
Definition: handler.h:2312
Clone_begin_t clone_begin
Definition: handler.h:2306
Clone_copy_t clone_copy
Definition: handler.h:2307
Clone_apply_end_t clone_apply_end
Definition: handler.h:2314
Clone_ack_t clone_ack
Definition: handler.h:2308
Definition: ft_global.h:72
Definition: handler.h:3979
uchar * buffer_end
Definition: handler.h:3981
uchar * buffer
Definition: handler.h:3980
uchar * end_of_used_area
Definition: handler.h:3982
Definition: handler.h:3966
KEY_CACHE * key_cache
Definition: handler.h:3969
uint sql_flags
Definition: handler.h:3968
uint flags
Definition: handler.h:3967
Struct to hold information about the table that should be created.
Definition: handler.h:3356
ulonglong auto_increment_value
Definition: handler.h:3399
bool m_hidden
Definition: handler.h:3431
bool m_transactional_ddl
Definition: handler.h:3437
PT_create_external_file_format * file_format
Definition: handler.h:3446
bool m_implicit_tablespace_autoextend_size_change
Definition: handler.h:3444
handlerton * db_type
Definition: handler.h:3410
LEX_STRING compress
Algorithm (and possible options) to be used for InnoDB's transparent page compression.
Definition: handler.h:3372
LEX_STRING encrypt_type
This attribute is used for InnoDB's transparent page encryption.
Definition: handler.h:3380
LEX_CSTRING engine_attribute
Definition: handler.h:3439
ulong avg_row_length
Definition: handler.h:3401
size_t create_table_columns_end_pos
Definition: handler.h:3451
const CHARSET_INFO * table_charset
Definition: handler.h:3357
PT_create_external_files * external_files
Definition: handler.h:3447
const char * data_file_name
Definition: handler.h:3394
LEX_CSTRING auto_refresh_event_source
Definition: handler.h:3448
ulonglong m_implicit_tablespace_autoextend_size
Definition: handler.h:3442
bool secondary_load
Secondary engine load status.
Definition: handler.h:3388
const CHARSET_INFO * default_table_charset
Definition: handler.h:3358
uint stats_sample_pages
Definition: handler.h:3406
const char * alias
Definition: handler.h:3396
uint null_bits
Definition: handler.h:3421
uint merge_insert_method
Definition: handler.h:3423
LEX_STRING connect_string
Definition: handler.h:3360
partition_info * part_info
Part info in order to maintain in HA_CREATE_INFO the per-partition secondary_load status.
Definition: handler.h:3392
const char * tablespace
Definition: handler.h:3362
ulonglong max_rows
Definition: handler.h:3397
void init_create_options_from_share(const TABLE_SHARE *share, uint64_t used_fields)
Fill HA_CREATE_INFO to be used by ALTER as well as upgrade code.
Definition: handler.cc:2677
const char * password
Definition: handler.h:3361
ha_storage_media storage_media
Definition: handler.h:3424
LEX_STRING comment
Definition: handler.h:3363
const char * index_file_name
Definition: handler.h:3395
SQL_I_List< Table_ref > merge_list
Definition: handler.h:3409
std::uint32_t key_block_size
Definition: handler.h:3405
uint64_t table_options
Definition: handler.h:3400
LEX_CSTRING secondary_engine_attribute
Definition: handler.h:3440
LEX_CSTRING secondary_engine
Secondary engine of the table.
Definition: handler.h:3386
bool set_db_type(THD *thd)
Populate the db_type member depending on internal state and thd variables.
Definition: handler.cc:2789
ulonglong min_rows
Definition: handler.h:3398
uint64_t used_fields
Definition: handler.h:3402
bool schema_read_only
Definition: handler.h:3359
enum_stats_auto_recalc stats_auto_recalc
Definition: handler.h:3408
File reference for clone.
Definition: handler.h:1021
@ FILE_DESC
File descriptor.
Definition: handler.h:1028
@ FILE_HANDLE
File handle.
Definition: handler.h:1025
void * file_handle
File handle for windows.
Definition: handler.h:1038
int file_desc
File descriptor.
Definition: handler.h:1035
enum Ha_clone_file::@57 type
File reference type.
Column type description for foreign key columns compatibility check.
Definition: handler.h:1246
size_t elements_count
Definition: handler.h:1254
bool is_unsigned
Definition: handler.h:1256
size_t char_length
Definition: handler.h:1252
const CHARSET_INFO * field_charset
Definition: handler.h:1253
uint numeric_scale
Definition: handler.h:1255
dd::enum_column_types type
Definition: handler.h:1247
A struct containing a join hypergraph of a single query block, encapsulating the constraints given by...
Definition: make_join_hypergraph.h:99
Definition: keycache.h:73
Definition: my_base.h:1219
Structure describing changes to an index to be caused by ALTER TABLE.
Definition: handler.h:3480
KEY * new_key
Pointer to KEY object describing new version of index in Alter_inplace_info::key_info_buffer array.
Definition: handler.h:3491
KEY * old_key
Pointer to KEY object describing old version of index in TABLE::key_info array for TABLE instance rep...
Definition: handler.h:3486
The LEX object currently serves three different purposes:
Definition: sql_lex.h:4021
Metadata lock object key.
Definition: mdl.h:366
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
Definition: my_bitmap.h:43
State data storage for start_table_io_wait_v1_t, start_table_lock_wait_v1_t.
Definition: psi_table_bits.h:69
Page track interface.
Definition: handler.h:2832
page_track_get_num_page_ids_t get_num_page_ids
Definition: handler.h:2837
page_track_purge_t purge
Definition: handler.h:2835
page_track_start_t start
Definition: handler.h:2833
page_track_stop_t stop
Definition: handler.h:2834
page_track_get_status_t get_status
Definition: handler.h:2838
page_track_get_page_ids_t get_page_ids
Definition: handler.h:2836
Definition: handler.h:3987
range_seq_t(* init)(void *init_params, uint n_ranges, uint flags)
Definition: handler.h:4000
uint(* next)(range_seq_t seq, KEY_MULTI_RANGE *range)
Definition: handler.h:4014
bool(* skip_record)(range_seq_t seq, char *range_info, uchar *rowid)
Definition: handler.h:4031
Definition: transaction_info.h:58
Definition: handler.h:2579
bool is_enabled
Indicates if simplification is guided using secondary engine.
Definition: handler.h:2585
int subgraph_pair_limit
Subgraph pairs requested by the secondary engine.
Definition: handler.h:2583
SecondaryEngineGraphSimplificationRequest secondary_engine_optimizer_request
Optimizer request from the secondary engine.
Definition: handler.h:2581
Type for signature generation and for retrieving nrows estimate from secondary engine for current Acc...
Definition: handler.h:2486
bool to_force_resign
if ap->signature generation should be forced.
Definition: handler.h:2500
OverflowBitset applied_predicates
Predicates actually applied for AccessPath::REF and other parameterized types.
Definition: handler.h:2495
SecondaryEngineNrowsParameters(THD *thd)
Definition: handler.h:2508
THD * thd
The thread context.
Definition: handler.h:2488
AccessPath * access_path
The AccessPath to retrieve Nrows for.
Definition: handler.h:2490
const JoinHypergraph * graph
Hypergraph for current query block.
Definition: handler.h:2492
size_t * extra_sig
if nonnull, an additional signature should be combined with current AP.
Definition: handler.h:2502
SecondaryEngineNrowsParameters(THD *thd, AccessPath *access_path, const JoinHypergraph *graph)
Definition: handler.h:2504
bool to_update_rows
if ap->nrows should be acually updated.
Definition: handler.h:2497
Per thread status variables.
Definition: system_variables.h:539
This structure is shared between different table objects.
Definition: table.h:731
Definition: thr_lock.h:124
Structure used by parser to store options for tablespace statements and pass them on to Execution cla...
Definition: sql_tablespace.h:43
Info about FULLTEXT index hints, passed to the storage engine.
Definition: ft_global.h:117
double op_value
Operation value.
Definition: ft_global.h:123
ha_rows limit
LIMIT value, HA_POS_ERROR if not set.
Definition: ft_global.h:125
enum ft_operation op_type
Operation type.
Definition: ft_global.h:121
uint flags
FULLTEXT flags, see FT_NL, etc.
Definition: ft_global.h:119
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2852
sdi_get_keys_t sdi_get_keys
Definition: handler.h:2960
sdi_drop_t sdi_drop
Definition: handler.h:2959
unlock_hton_log_t unlock_hton_log
Definition: handler.h:3018
notify_alter_table_t notify_alter_table
Definition: handler.h:2991
dict_cache_reset_t dict_cache_reset
Definition: handler.h:2929
void * data
Location for engines to keep personal structures.
Definition: handler.h:3011
set_prepared_in_tc_by_xid_t set_prepared_in_tc_by_xid
Definition: handler.h:2902
se_before_rollback_t se_before_rollback
Definition: handler.h:3129
sdi_set_t sdi_set
Definition: handler.h:2962
lock_hton_log_t lock_hton_log
Definition: handler.h:3017
is_dict_readonly_t is_dict_readonly
Definition: handler.h:2986
alter_tablespace_t alter_tablespace
Definition: handler.h:2913
finish_upgrade_t finish_upgrade
Definition: handler.h:2924
create_t create
Definition: handler.h:2903
collect_hton_log_info_t collect_hton_log_info
Definition: handler.h:3019
secondary_engine_pre_prepare_hook_t secondary_engine_pre_prepare_hook
Definition: handler.h:3121
notify_materialized_view_usage_t notify_materialized_view_usage
Definition: handler.h:3136
dict_register_dd_table_id_t dict_register_dd_table_id
Definition: handler.h:2928
redo_log_set_state_t redo_log_set_state
Definition: handler.h:2995
find_files_t find_files
Definition: handler.h:2949
external_engine_explain_check_t external_engine_explain_check
Pointer to a function that checks if the table is loaded in the secondary engine in the case of an ex...
Definition: handler.h:3071
ddse_dict_init_t ddse_dict_init
Definition: handler.h:2927
replace_native_transaction_in_thd_t replace_native_transaction_in_thd
Definition: handler.h:2989
LEX_CSTRING fk_name_suffix
Suffix for auto-generated foreign key names for tables using this storage engine.
Definition: handler.h:3034
pre_dd_shutdown_t pre_dd_shutdown
Definition: handler.h:2888
check_fk_column_compat_t check_fk_column_compat
Definition: handler.h:3024
cardinality_estimation_hook_t cardinality_estimation_hook
Definition: handler.h:3125
SecondaryEngineFlags secondary_engine_flags
Bitmap which contains the supported join types and other flags for a secondary storage engine when us...
Definition: handler.h:3065
uint32 license
Flag for Engine License.
Definition: handler.h:3009
is_supported_system_table_t is_supported_system_table
Definition: handler.h:2952
commit_t commit
Definition: handler.h:2894
get_tablespace_statistics_t get_tablespace_statistics
Definition: handler.h:3000
se_after_commit_t se_after_commit
Definition: handler.h:3128
savepoint_set_t savepoint_set
Definition: handler.h:2890
uint savepoint_offset
To store per-savepoint data storage engine is provided with an area of a requested size (0 is ok here...
Definition: handler.h:2882
drop_database_t drop_database
Definition: handler.h:2904
savepoint_release_t savepoint_release
Definition: handler.h:2893
enum legacy_db_type db_type
Historical number used for frm file to determine the correct storage engine.
Definition: handler.h:2862
is_valid_tablespace_name_t is_valid_tablespace_name
Definition: handler.h:2912
se_before_commit_t se_before_commit
Definition: handler.h:3127
flush_logs_t flush_logs
Definition: handler.h:2909
log_ddl_create_schema_t log_ddl_create_schema
Definition: handler.h:2906
uint slot
Each storage engine has it's own memory area (actually a pointer) in the thd, for storing per-connect...
Definition: handler.h:2872
find_secondary_engine_offload_fail_reason_t find_secondary_engine_offload_fail_reason
Pointer to a function that finds and returns the query offload failure reason as a string given a thr...
Definition: handler.h:3101
dict_get_server_version_t dict_get_server_version
Definition: handler.h:2933
get_tablespace_type_t get_tablespace_type
Definition: handler.h:2919
close_connection_t close_connection
Definition: handler.h:2886
rotate_encryption_master_key_t rotate_encryption_master_key
Definition: handler.h:2994
secondary_engine_check_optimizer_request_t secondary_engine_check_optimizer_request
Pointer to function that checks secondary engine request for updating hypergraph join optimization.
Definition: handler.h:3116
notify_truncate_table_t notify_truncate_table
Definition: handler.h:2993
start_consistent_snapshot_t start_consistent_snapshot
Definition: handler.h:2908
savepoint_rollback_t savepoint_rollback
Definition: handler.h:2891
fill_is_table_t fill_is_table
Definition: handler.h:2925
binlog_func_t binlog_func
Definition: handler.h:2945
optimize_secondary_engine_t optimize_secondary_engine
Pointer to a function that optimizes the current statement for execution on the secondary storage eng...
Definition: handler.h:3051
log_ddl_drop_schema_t log_ddl_drop_schema
Definition: handler.h:2905
notify_exclusive_mdl_t notify_exclusive_mdl
Definition: handler.h:2990
get_cost_constants_t get_cost_constants
Definition: handler.h:2988
set_secondary_engine_offload_fail_reason_t set_secondary_engine_offload_fail_reason
Pointer to a function that sets the offload failure reason as a string for a thread context (represen...
Definition: handler.h:3109
notify_create_table_t notify_create_table
Definition: handler.h:3133
rollback_by_xid_t rollback_by_xid
Definition: handler.h:2900
sdi_delete_t sdi_delete
Definition: handler.h:2963
get_index_column_cardinality_t get_index_column_cardinality
Definition: handler.h:2999
rollback_t rollback
Definition: handler.h:2895
dict_recover_t dict_recover
Definition: handler.h:2932
rm_tmp_tables_t rm_tmp_tables
Definition: handler.h:2987
prepare_secondary_engine_t prepare_secondary_engine
Pointer to a function that prepares a secondary engine for executing a statement.
Definition: handler.h:3042
get_table_statistics_t get_table_statistics
Definition: handler.h:2997
Page_track_t page_track
Page tracking interface.
Definition: handler.h:3139
sdi_create_t sdi_create
Definition: handler.h:2958
notify_drop_table_t notify_drop_table
Definition: handler.h:3134
dict_init_t dict_init
Definition: handler.h:2926
uint32 foreign_keys_flags
Flags describing details of foreign key support by storage engine.
Definition: handler.h:3022
binlog_log_query_t binlog_log_query
Definition: handler.h:2946
get_tablespace_filename_ext_t get_tablespace_filename_ext
Definition: handler.h:2914
upgrade_logs_t upgrade_logs
Definition: handler.h:2922
get_secondary_engine_offload_or_exec_fail_reason_t get_secondary_engine_offload_or_exec_fail_reason
Pointer to a function that returns the query offload or exec failure reason as a string given a threa...
Definition: handler.h:3092
partition_flags_t partition_flags
Definition: handler.h:2911
const char ** file_extensions
Null-ended array of file extensions that exist for the storage engine.
Definition: handler.h:2984
dict_cache_reset_tables_and_tablespaces_t dict_cache_reset_tables_and_tablespaces
Definition: handler.h:2931
push_to_engine_t push_to_engine
Definition: handler.h:2951
Clone_interface_t clone_interface
Clone data transfer interfaces.
Definition: handler.h:3006
recover_prepared_in_tc_t recover_prepared_in_tc
Definition: handler.h:2898
discover_t discover
Definition: handler.h:2948
table_exists_in_engine_t table_exists_in_engine
Definition: handler.h:2950
upgrade_tablespace_t upgrade_tablespace
Definition: handler.h:2916
sdi_get_t sdi_get
Definition: handler.h:2961
reset_plugin_vars_t reset_plugin_vars
Definition: handler.h:2889
get_tablespace_type_by_name_t get_tablespace_type_by_name
Definition: handler.h:2920
dict_set_server_version_t dict_set_server_version
Definition: handler.h:2934
recover_t recover
Definition: handler.h:2897
SHOW_COMP_OPTION state
Historical marker for if the engine is available or not.
Definition: handler.h:2856
post_recover_t post_recover
Definition: handler.h:3003
uint32 flags
Global handler flags.
Definition: handler.h:2938
upgrade_space_version_t upgrade_space_version
Definition: handler.h:2918
kill_connection_t kill_connection
Definition: handler.h:2887
get_column_statistics_t get_column_statistics
Definition: handler.h:2998
prepare_t prepare
Definition: handler.h:2896
panic_t panic
Definition: handler.h:2907
post_ddl_t post_ddl
Definition: handler.h:3002
compare_secondary_engine_cost_t compare_secondary_engine_cost
Pointer to a function that estimates the cost of executing a join in a secondary storage engine.
Definition: handler.h:3059
notify_after_select_t notify_after_select
Definition: handler.h:3131
commit_by_xid_t commit_by_xid
Definition: handler.h:2899
set_prepared_in_tc_t set_prepared_in_tc
Definition: handler.h:2901
acl_notify_t acl_notify
Definition: handler.h:2947
show_status_t show_status
Definition: handler.h:2910
secondary_engine_modify_view_ap_cost_t secondary_engine_modify_view_ap_cost
Pointer to a function that evaluates the cost of executing an access path in a secondary storage engi...
Definition: handler.h:3077
is_reserved_db_name_t is_reserved_db_name
Definition: handler.h:2935
savepoint_rollback_can_release_mdl_t savepoint_rollback_can_release_mdl
Definition: handler.h:2892
secondary_engine_nrows_t secondary_engine_nrows
Pointer to a function that provides nrow estimates for access paths from secondary storage engine.
Definition: handler.h:3083
notify_rename_table_t notify_rename_table
Definition: handler.h:2992
Definition: my_base.h:1212
Definition: gen_lex_token.cc:149
Key to identify a dictionary object.
Definition: handler.h:135
uint32 type
Type of Object, For ex: column, index, etc.
Definition: handler.h:137
uint64 id
Object id which should be unique in tablespsace.
Definition: handler.h:140
Definition: handler.h:144
sdi_container m_vec
Definition: handler.h:145
Definition: handler.h:845
const char * db
Definition: handler.h:846
const char * tablename
Definition: handler.h:847
Definition: sql_plugin_ref.h:45
Plain structure to store information about XA transaction id and a list of table names involved into ...
Definition: xa.h:290
Definition: mysqlslap.cc:243
struct xid_t is binary compatible with the XID structure as in the X/Open CAE Specification,...
Definition: xa.h:83
thr_lock_type
Definition: thr_lock.h:51
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510
static uint64_t cache_size
Definition: xcom_cache.cc:363
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:890