1#ifndef HANDLER_INCLUDED
2#define HANDLER_INCLUDED
144 uint key_length,
ulonglong *engine_data);
147 const char *
file,
size_t file_len,
148 const char *
status,
size_t status_len);
178#define HA_ADMIN_ALREADY_DONE 1
180#define HA_ADMIN_NOT_IMPLEMENTED -1
181#define HA_ADMIN_FAILED -2
182#define HA_ADMIN_CORRUPT -3
183#define HA_ADMIN_INTERNAL_ERROR -4
184#define HA_ADMIN_INVALID -5
185#define HA_ADMIN_REJECT -6
186#define HA_ADMIN_TRY_ALTER -7
187#define HA_ADMIN_WRONG_CHECKSUM -8
188#define HA_ADMIN_NOT_BASE_TABLE -9
189#define HA_ADMIN_NEEDS_UPGRADE -10
190#define HA_ADMIN_NEEDS_ALTER -11
191#define HA_ADMIN_NEEDS_CHECK -12
192#define HA_ADMIN_STATS_UPD_ERR -13
194#define HA_ADMIN_NEEDS_DUMP_UPGRADE -14
220#define HA_NO_TRANSACTIONS (1 << 0)
221#define HA_PARTIAL_COLUMN_READ (1 << 1)
228#define HA_TABLE_SCAN_ON_INDEX (1 << 2)
231#define HA_UNUSED3 (1 << 3)
238#define HA_CAN_GEOMETRY (1 << 4)
244#define HA_FAST_KEY_READ (1 << 5)
249#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
255#define HA_NULL_IN_KEY (1 << 7)
261#define HA_DUPLICATE_POS (1 << 8)
262#define HA_NO_BLOBS (1 << 9)
267#define HA_CAN_INDEX_BLOBS (1 << 10)
272#define HA_AUTO_PART_KEY (1 << 11)
277#define HA_REQUIRE_PRIMARY_KEY (1 << 12)
282#define HA_STATS_RECORDS_IS_EXACT (1 << 13)
284#define HA_UNUSED14 (1 << 14)
291#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
299#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
300#define HA_CAN_RTREEKEYS (1 << 17)
307#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
311#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
315#define HA_CAN_FULLTEXT (1 << 21)
320#define HA_CAN_SQL_HANDLER (1 << 22)
324#define HA_NO_AUTO_INCREMENT (1 << 23)
328#define HA_HAS_CHECKSUM (1 << 24)
334#define HA_FILE_BASED (1 << 26)
335#define HA_NO_VARCHAR (1 << 27)
339#define HA_CAN_BIT_FIELD (1 << 28)
340#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
341#define HA_NO_COPY_ON_ALTER (1LL << 31)
342#define HA_COUNT_ROWS_INSTANT (1LL << 32)
344#define HA_HAS_OWN_BINLOGGING (1LL << 33)
349#define HA_BINLOG_ROW_CAPABLE (1LL << 34)
350#define HA_BINLOG_STMT_CAPABLE (1LL << 35)
373#define HA_DUPLICATE_KEY_NOT_IN_ORDER (1LL << 36)
379#define HA_CAN_REPAIR (1LL << 37)
385#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
421#define HA_READ_BEFORE_WRITE_REMOVAL (1LL << 38)
426#define HA_CAN_FULLTEXT_EXT (1LL << 39)
434#define HA_READ_OUT_OF_SYNC (1LL << 40)
440#define HA_CAN_EXPORT (1LL << 41)
446#define HA_BLOCK_CONST_TABLE (1LL << 42)
451#define HA_CAN_FULLTEXT_HINTS (1LL << 43)
459#define HA_NO_READ_LOCAL_LOCK (1LL << 44)
472#define HA_ATTACHABLE_TRX_COMPATIBLE (1LL << 45)
477#define HA_GENERATED_COLUMNS (1LL << 46)
482#define HA_CAN_INDEX_VIRTUAL_GENERATED_COLUMN (1LL << 47)
487#define HA_DESCENDING_INDEX (1LL << 48)
492#define HA_BLOB_PARTIAL_UPDATE (1LL << 49)
499#define HA_SUPPORTS_GEOGRAPHIC_GEOMETRY_COLUMN (1LL << 50)
504#define HA_SUPPORTS_DEFAULT_EXPRESSION (1LL << 51)
509#define HA_UPDATE_NOT_SUPPORTED (1LL << 52)
514#define HA_DELETE_NOT_SUPPORTED (1LL << 53)
520#define HA_NO_INDEX_ACCESS (1LL << 54)
525#define HA_MULTI_VALUED_KEY_SUPPORT (1LL << 55)
536#define HA_READ_NEXT 1
540#define HA_READ_PREV 2
552#define HA_READ_ORDER 4
559#define HA_READ_RANGE 8
564#define HA_ONLY_WHOLE_INDEX 16
571#define HA_TABLE_SCAN_ON_NULL 32
581#define HA_KEYREAD_ONLY 64
586#define HA_KEY_SCAN_NOT_ROR 128
587#define HA_DO_INDEX_COND_PUSHDOWN 256
590#define HA_KEY_SWITCH_NONUNIQ 0
591#define HA_KEY_SWITCH_ALL 1
592#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
593#define HA_KEY_SWITCH_ALL_SAVE 3
600#define HA_SLOT_UNDEF ((uint)-1)
607#define HA_OPEN_KEYFILE 1
608#define HA_OPEN_RNDFILE 2
609#define HA_GET_INDEX 4
611#define HA_READ_ONLY 16
613#define HA_TRY_READ_ONLY 32
614#define HA_WAIT_IF_LOCKED 64
615#define HA_ABORT_IF_LOCKED 128
616#define HA_BLOCK_LOCK 256
617#define HA_OPEN_TEMPORARY 512
620#define HA_KEY_NULL_LENGTH 1
621#define HA_KEY_BLOB_LENGTH 2
623#define HA_LEX_CREATE_TMP_TABLE 1
624#define HA_LEX_CREATE_IF_NOT_EXISTS 2
625#define HA_LEX_CREATE_TABLE_LIKE 4
626#define HA_LEX_CREATE_INTERNAL_TMP_TABLE 8
627#define HA_MAX_REC_LENGTH 65535U
720#define HA_CREATE_USED_AUTO (1L << 0)
721#define HA_CREATE_USED_RAID (1L << 1)
722#define HA_CREATE_USED_UNION (1L << 2)
723#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
724#define HA_CREATE_USED_MIN_ROWS (1L << 4)
725#define HA_CREATE_USED_MAX_ROWS (1L << 5)
726#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
727#define HA_CREATE_USED_PACK_KEYS (1L << 7)
728#define HA_CREATE_USED_CHARSET (1L << 8)
729#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
730#define HA_CREATE_USED_DATADIR (1L << 10)
731#define HA_CREATE_USED_INDEXDIR (1L << 11)
732#define HA_CREATE_USED_ENGINE (1L << 12)
733#define HA_CREATE_USED_CHECKSUM (1L << 13)
734#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
735#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
736#define HA_CREATE_USED_COMMENT (1L << 16)
737#define HA_CREATE_USED_PASSWORD (1L << 17)
738#define HA_CREATE_USED_CONNECTION (1L << 18)
739#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
741#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
743#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
749#define HA_CREATE_USED_STATS_PERSISTENT (1L << 22)
756#define HA_CREATE_USED_STATS_AUTO_RECALC (1L << 23)
763#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1L << 24)
768#define HA_CREATE_USED_TABLESPACE (1L << 25)
771#define HA_CREATE_USED_COMPRESS (1L << 26)
774#define HA_CREATE_USED_ENCRYPT (1L << 27)
781#define HA_CREATE_USED_DEFAULT_COLLATE (1L << 28)
784#define HA_CREATE_USED_SECONDARY_ENGINE (1L << 29)
791#define HA_CREATE_USED_DEFAULT_ENCRYPTION (1L << 30)
828#define MAXGTRIDSIZE 64
829#define MAXBQUALSIZE 64
831#define COMPATIBLE_DATA_YES 0
832#define COMPATIBLE_DATA_NO 1
838#define UNDEF_NODEGROUP 65535
917 const char *datafile,
const char *undofile,
1103 if (lenp !=
nullptr) {
1254 std::unordered_set<my_xid, std::hash<my_xid>, std::equal_to<my_xid>,
1263 using pair = std::pair<const XID, enum_ha_recover_xa_state>;
1265 using list = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1267 using iterator = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1270 std::unique_ptr<MEM_ROOT>, std::unique_ptr<Xa_state_list::allocator>,
1271 std::unique_ptr<Xa_state_list::list>, std::unique_ptr<Xa_state_list>>;
1496 const char *schema_name);
1499 const char *schema_name);
1541 const char *tablespace_name);
1586typedef const char *(*get_tablespace_filename_ext_t)();
1677 const char *
query, uint query_length,
1684 const char *
name,
uchar **frmblob,
size_t *frmlen);
1687 const char *
path,
const char *wild,
bool dir,
1691 const char *
db,
const char *
name);
1729 bool is_sql_layer_system_table);
1801 const void *sdi,
uint64 sdi_len);
1879 void **ptr_trx_arg);
2075 const char *old_db_name,
2076 const char *old_table_name,
2077 const char *new_db_name,
2078 const char *new_table_name);
2171 uint index_ordinal_position, uint column_ordinal_position,
2190 const char *tablespace_name,
const char *
file_name,
2233 uint loc_len, uint task_id,
int in_err,
2245 uint loc_len, uint task_id,
int in_err);
2257 const uchar *&loc, uint &loc_len,
2259 const char *data_dir);
2271 uint loc_len, uint task_id,
int in_err,
2283 uint loc_len, uint task_id,
int in_err);
2407 double optimizer_cost,
2408 bool *use_best_so_far,
2410 double *secondary_engine_cost);
2488 std::string_view (*)(
const THD *thd);
2500 std::string_view (*)(
THD *thd);
2514 bool (*)(
const THD *thd, std::string_view reason);
2555 const AccessPath *access_path,
int current_subgraph_pairs,
2556 int current_subgraph_pairs_limit,
bool is_root_access_path,
2557 std::string *trace);
2584template <
typename... Args>
2587 return (uint64_t{1} <<
static_cast<int>(flag1)) |
2726 void *cbk_ctx, uint64_t *start_id,
2750 uint64_t *num_pages);
2756 void (*)(std::vector<std::pair<uint64_t, bool>> &
status);
3059#define HTON_NO_FLAGS 0
3060#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
3061#define HTON_ALTER_NOT_SUPPORTED (1 << 1)
3062#define HTON_CAN_RECREATE (1 << 2)
3063#define HTON_HIDDEN (1 << 3)
3068#define HTON_NOT_USER_SELECTABLE (1 << 5)
3069#define HTON_TEMPORARY_NOT_SUPPORTED \
3071#define HTON_SUPPORT_LOG_TABLES (1 << 7)
3072#define HTON_NO_PARTITION (1 << 8)
3087#define HTON_NO_BINLOG_ROW_OPT (1 << 9)
3097#define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10)
3101#define HTON_SUPPORTS_FOREIGN_KEYS (1 << 11)
3109#define HTON_SUPPORTS_ATOMIC_DDL (1 << 12)
3112#define HTON_SUPPORTS_PACKED_KEYS (1 << 13)
3115#define HTON_IS_SECONDARY_ENGINE (1 << 14)
3118#define HTON_SUPPORTS_SECONDARY_ENGINE (1 << 15)
3121#define HTON_SUPPORTS_TABLE_ENCRYPTION (1 << 16)
3128constexpr const decltype(
3134#define HTON_SECONDARY_ENGINE_SUPPORTS_DDL (1 << 19)
3137#define HTON_NO_TRIGGER_SUPPORT (1 << 20)
3145#define HTON_SUPPORTS_EXTERNAL_SOURCE (1 << 21)
3396 [[maybe_unused]]) {}
3764 Alter_info *alter_info_arg,
bool error_if_not_empty_arg,
3765 KEY *key_info_arg, uint key_count_arg,
3803 const char *try_instead);
3811 (
"index renamed: '%s' to '%s'", old_key->
name, new_key->
name));
3819 DBUG_PRINT(
"info", (
"index had visibility altered: %i to %i",
4004 return other > *
this ? true :
false;
4040#define HA_MRR_SINGLE_POINT 1
4041#define HA_MRR_FIXED_KEY 2
4047#define HA_MRR_NO_ASSOCIATION 4
4057#define HA_MRR_SORTED 8
4060#define HA_MRR_INDEX_ONLY 16
4066#define HA_MRR_LIMITS 32
4074#define HA_MRR_USE_DEFAULT_IMPL 64
4081#define HA_MRR_NO_NULL_ENDPOINTS 128
4089#define HA_MRR_SUPPORT_SORTED 256
4169#define make_keypart_map(N) (((key_part_map)2 << (N)) - 1)
4174#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
4890 DBUG_PRINT(
"info", (
"handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
4891 F_UNLCK, F_RDLCK, F_WRLCK));
4895 assert(
m_psi ==
nullptr);
5007 uint *dup_key_found);
5027 bool error_if_not_loaded);