1#ifndef HANDLER_INCLUDED
2#define HANDLER_INCLUDED
141 uint key_length,
ulonglong *engine_data);
144 const char *
file,
size_t file_len,
145 const char *
status,
size_t status_len);
174#define HA_ADMIN_ALREADY_DONE 1
176#define HA_ADMIN_NOT_IMPLEMENTED -1
177#define HA_ADMIN_FAILED -2
178#define HA_ADMIN_CORRUPT -3
179#define HA_ADMIN_INTERNAL_ERROR -4
180#define HA_ADMIN_INVALID -5
181#define HA_ADMIN_REJECT -6
182#define HA_ADMIN_TRY_ALTER -7
183#define HA_ADMIN_WRONG_CHECKSUM -8
184#define HA_ADMIN_NOT_BASE_TABLE -9
185#define HA_ADMIN_NEEDS_UPGRADE -10
186#define HA_ADMIN_NEEDS_ALTER -11
187#define HA_ADMIN_NEEDS_CHECK -12
188#define HA_ADMIN_STATS_UPD_ERR -13
190#define HA_ADMIN_NEEDS_DUMP_UPGRADE -14
216#define HA_NO_TRANSACTIONS (1 << 0)
217#define HA_PARTIAL_COLUMN_READ (1 << 1)
224#define HA_TABLE_SCAN_ON_INDEX (1 << 2)
227#define HA_UNUSED3 (1 << 3)
234#define HA_CAN_GEOMETRY (1 << 4)
240#define HA_FAST_KEY_READ (1 << 5)
245#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
251#define HA_NULL_IN_KEY (1 << 7)
257#define HA_DUPLICATE_POS (1 << 8)
258#define HA_NO_BLOBS (1 << 9)
263#define HA_CAN_INDEX_BLOBS (1 << 10)
268#define HA_AUTO_PART_KEY (1 << 11)
273#define HA_REQUIRE_PRIMARY_KEY (1 << 12)
278#define HA_STATS_RECORDS_IS_EXACT (1 << 13)
280#define HA_UNUSED14 (1 << 14)
287#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
295#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
296#define HA_CAN_RTREEKEYS (1 << 17)
303#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
307#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
311#define HA_CAN_FULLTEXT (1 << 21)
316#define HA_CAN_SQL_HANDLER (1 << 22)
320#define HA_NO_AUTO_INCREMENT (1 << 23)
324#define HA_HAS_CHECKSUM (1 << 24)
330#define HA_FILE_BASED (1 << 26)
331#define HA_NO_VARCHAR (1 << 27)
335#define HA_CAN_BIT_FIELD (1 << 28)
336#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
337#define HA_NO_COPY_ON_ALTER (1LL << 31)
338#define HA_COUNT_ROWS_INSTANT (1LL << 32)
340#define HA_HAS_OWN_BINLOGGING (1LL << 33)
345#define HA_BINLOG_ROW_CAPABLE (1LL << 34)
346#define HA_BINLOG_STMT_CAPABLE (1LL << 35)
369#define HA_DUPLICATE_KEY_NOT_IN_ORDER (1LL << 36)
375#define HA_CAN_REPAIR (1LL << 37)
381#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
417#define HA_READ_BEFORE_WRITE_REMOVAL (1LL << 38)
422#define HA_CAN_FULLTEXT_EXT (1LL << 39)
430#define HA_READ_OUT_OF_SYNC (1LL << 40)
436#define HA_CAN_EXPORT (1LL << 41)
442#define HA_BLOCK_CONST_TABLE (1LL << 42)
447#define HA_CAN_FULLTEXT_HINTS (1LL << 43)
455#define HA_NO_READ_LOCAL_LOCK (1LL << 44)
468#define HA_ATTACHABLE_TRX_COMPATIBLE (1LL << 45)
473#define HA_GENERATED_COLUMNS (1LL << 46)
478#define HA_CAN_INDEX_VIRTUAL_GENERATED_COLUMN (1LL << 47)
483#define HA_DESCENDING_INDEX (1LL << 48)
488#define HA_BLOB_PARTIAL_UPDATE (1LL << 49)
495#define HA_SUPPORTS_GEOGRAPHIC_GEOMETRY_COLUMN (1LL << 50)
500#define HA_SUPPORTS_DEFAULT_EXPRESSION (1LL << 51)
505#define HA_UPDATE_NOT_SUPPORTED (1LL << 52)
510#define HA_DELETE_NOT_SUPPORTED (1LL << 53)
516#define HA_NO_INDEX_ACCESS (1LL << 54)
521#define HA_MULTI_VALUED_KEY_SUPPORT (1LL << 55)
532#define HA_READ_NEXT 1
536#define HA_READ_PREV 2
548#define HA_READ_ORDER 4
555#define HA_READ_RANGE 8
560#define HA_ONLY_WHOLE_INDEX 16
567#define HA_TABLE_SCAN_ON_NULL 32
577#define HA_KEYREAD_ONLY 64
582#define HA_KEY_SCAN_NOT_ROR 128
583#define HA_DO_INDEX_COND_PUSHDOWN 256
586#define HA_KEY_SWITCH_NONUNIQ 0
587#define HA_KEY_SWITCH_ALL 1
588#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
589#define HA_KEY_SWITCH_ALL_SAVE 3
596#define HA_SLOT_UNDEF ((uint)-1)
603#define HA_OPEN_KEYFILE 1
604#define HA_OPEN_RNDFILE 2
605#define HA_GET_INDEX 4
607#define HA_READ_ONLY 16
609#define HA_TRY_READ_ONLY 32
610#define HA_WAIT_IF_LOCKED 64
611#define HA_ABORT_IF_LOCKED 128
612#define HA_BLOCK_LOCK 256
613#define HA_OPEN_TEMPORARY 512
616#define HA_KEY_NULL_LENGTH 1
617#define HA_KEY_BLOB_LENGTH 2
619#define HA_LEX_CREATE_TMP_TABLE 1
620#define HA_LEX_CREATE_IF_NOT_EXISTS 2
621#define HA_LEX_CREATE_TABLE_LIKE 4
622#define HA_LEX_CREATE_INTERNAL_TMP_TABLE 8
623#define HA_MAX_REC_LENGTH 65535U
715#define HA_CREATE_USED_AUTO (1L << 0)
716#define HA_CREATE_USED_RAID (1L << 1)
717#define HA_CREATE_USED_UNION (1L << 2)
718#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
719#define HA_CREATE_USED_MIN_ROWS (1L << 4)
720#define HA_CREATE_USED_MAX_ROWS (1L << 5)
721#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
722#define HA_CREATE_USED_PACK_KEYS (1L << 7)
723#define HA_CREATE_USED_CHARSET (1L << 8)
724#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
725#define HA_CREATE_USED_DATADIR (1L << 10)
726#define HA_CREATE_USED_INDEXDIR (1L << 11)
727#define HA_CREATE_USED_ENGINE (1L << 12)
728#define HA_CREATE_USED_CHECKSUM (1L << 13)
729#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
730#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
731#define HA_CREATE_USED_COMMENT (1L << 16)
732#define HA_CREATE_USED_PASSWORD (1L << 17)
733#define HA_CREATE_USED_CONNECTION (1L << 18)
734#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
736#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
738#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
744#define HA_CREATE_USED_STATS_PERSISTENT (1L << 22)
751#define HA_CREATE_USED_STATS_AUTO_RECALC (1L << 23)
758#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1L << 24)
763#define HA_CREATE_USED_TABLESPACE (1L << 25)
766#define HA_CREATE_USED_COMPRESS (1L << 26)
769#define HA_CREATE_USED_ENCRYPT (1L << 27)
776#define HA_CREATE_USED_DEFAULT_COLLATE (1L << 28)
779#define HA_CREATE_USED_SECONDARY_ENGINE (1L << 29)
786#define HA_CREATE_USED_DEFAULT_ENCRYPTION (1L << 30)
823#define MAXGTRIDSIZE 64
824#define MAXBQUALSIZE 64
826#define COMPATIBLE_DATA_YES 0
827#define COMPATIBLE_DATA_NO 1
833#define UNDEF_NODEGROUP 65535
912 const char *datafile,
const char *undofile,
1099 if (lenp !=
nullptr) {
1250 std::unordered_set<my_xid, std::hash<my_xid>, std::equal_to<my_xid>,
1259 using pair = std::pair<const XID, enum_ha_recover_xa_state>;
1261 using list = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1263 using iterator = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1266 std::unique_ptr<MEM_ROOT>, std::unique_ptr<Xa_state_list::allocator>,
1267 std::unique_ptr<Xa_state_list::list>, std::unique_ptr<Xa_state_list>>;
1531 const char *tablespace_name);
1576typedef const char *(*get_tablespace_filename_ext_t)();
1667 const char *
query, uint query_length,
1674 const char *
name,
uchar **frmblob,
size_t *frmlen);
1677 const char *
path,
const char *wild,
bool dir,
1681 const char *
db,
const char *
name);
1719 bool is_sql_layer_system_table);
1791 const void *sdi,
uint64 sdi_len);
1869 void **ptr_trx_arg);
2067 const char *old_db_name,
2068 const char *old_table_name,
2069 const char *new_db_name,
2070 const char *new_table_name);
2151 uint index_ordinal_position, uint column_ordinal_position,
2170 const char *tablespace_name,
const char *
file_name,
2213 uint loc_len, uint task_id,
int in_err,
2225 uint loc_len, uint task_id,
int in_err);
2237 const uchar *&loc, uint &loc_len,
2239 const char *data_dir);
2251 uint loc_len, uint task_id,
int in_err,
2263 uint loc_len, uint task_id,
int in_err);
2387 double optimizer_cost,
2388 bool *use_best_so_far,
2390 double *secondary_engine_cost);
2456 const char *(*)(
THD *thd);
2506 const AccessPath *access_path,
int current_subgraph_pairs,
2507 int current_subgraph_pairs_limit,
bool is_root_access_path,
2508 std::string *trace);
2535template <
typename... Args>
2538 return (uint64_t{1} <<
static_cast<int>(flag1)) |
2639 void *cbk_ctx, uint64_t *start_id,
2663 uint64_t *num_pages);
2669 void (*)(std::vector<std::pair<uint64_t, bool>> &
status);
2946#define HTON_NO_FLAGS 0
2947#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
2948#define HTON_ALTER_NOT_SUPPORTED (1 << 1)
2949#define HTON_CAN_RECREATE (1 << 2)
2950#define HTON_HIDDEN (1 << 3)
2955#define HTON_NOT_USER_SELECTABLE (1 << 5)
2956#define HTON_TEMPORARY_NOT_SUPPORTED \
2958#define HTON_SUPPORT_LOG_TABLES (1 << 7)
2959#define HTON_NO_PARTITION (1 << 8)
2974#define HTON_NO_BINLOG_ROW_OPT (1 << 9)
2984#define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10)
2988#define HTON_SUPPORTS_FOREIGN_KEYS (1 << 11)
2996#define HTON_SUPPORTS_ATOMIC_DDL (1 << 12)
2999#define HTON_SUPPORTS_PACKED_KEYS (1 << 13)
3002#define HTON_IS_SECONDARY_ENGINE (1 << 14)
3005#define HTON_SUPPORTS_SECONDARY_ENGINE (1 << 15)
3008#define HTON_SUPPORTS_TABLE_ENCRYPTION (1 << 16)
3015constexpr const decltype(
3021#define HTON_SECONDARY_ENGINE_SUPPORTS_DDL (1 << 19)
3024#define HTON_NO_TRIGGER_SUPPORT (1 << 20)
3032#define HTON_SUPPORTS_EXTERNAL_SOURCE (1 << 21)
3271 [[maybe_unused]]) {}
3639 Alter_info *alter_info_arg,
bool error_if_not_empty_arg,
3640 KEY *key_info_arg, uint key_count_arg,
3676 const char *try_instead);
3684 (
"index renamed: '%s' to '%s'", old_key->
name, new_key->
name));
3692 DBUG_PRINT(
"info", (
"index had visibility altered: %i to %i",
3877 return other > *
this ? true :
false;
3913#define HA_MRR_SINGLE_POINT 1
3914#define HA_MRR_FIXED_KEY 2
3920#define HA_MRR_NO_ASSOCIATION 4
3930#define HA_MRR_SORTED 8
3933#define HA_MRR_INDEX_ONLY 16
3939#define HA_MRR_LIMITS 32
3947#define HA_MRR_USE_DEFAULT_IMPL 64
3954#define HA_MRR_NO_NULL_ENDPOINTS 128
3962#define HA_MRR_SUPPORT_SORTED 256
4035#define make_keypart_map(N) (((key_part_map)2 << (N)) - 1)
4040#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
4757 DBUG_PRINT(
"info", (
"handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
4758 F_UNLCK, F_RDLCK, F_WRLCK));
4762 assert(
m_psi ==
nullptr);
4874 uint *dup_key_found);
4894 bool error_if_not_loaded);
4912 size_t *num_threads [[maybe_unused]],
4913 bool use_reserved_threads [[maybe_unused]],
4914 size_t max_desired_threads [[maybe_unused]]) {
4938 void *cookie, ulong ncols, ulong row_len,
const ulong *col_offsets,
4939 const ulong *null_byte_offsets,
const ulong *null_bitmasks)>;
4953 using Load_cbk = std::function<bool(
void *cookie, uint nrows,
void *rowdata,
4954 uint64_t partition_id)>;
4977 void **thread_ctxs [[maybe_unused]],
5011 size_t data_size [[maybe_unused]],
5012 size_t memory [[maybe_unused]],
5013 size_t num_threads [[maybe_unused]]) {
5025 void *load_ctx [[maybe_unused]],
5026 size_t thread_idx [[maybe_unused]],
5040 void *load_ctx [[maybe_unused]],
5041 bool is_error [[maybe_unused]]) {