1#ifndef HANDLER_INCLUDED
2#define HANDLER_INCLUDED
142 const char *
file,
size_t file_len,
143 const char *
status,
size_t status_len);
172#define HA_ADMIN_ALREADY_DONE 1
174#define HA_ADMIN_NOT_IMPLEMENTED -1
175#define HA_ADMIN_FAILED -2
176#define HA_ADMIN_CORRUPT -3
177#define HA_ADMIN_INTERNAL_ERROR -4
178#define HA_ADMIN_INVALID -5
179#define HA_ADMIN_REJECT -6
180#define HA_ADMIN_TRY_ALTER -7
181#define HA_ADMIN_WRONG_CHECKSUM -8
182#define HA_ADMIN_NOT_BASE_TABLE -9
183#define HA_ADMIN_NEEDS_UPGRADE -10
184#define HA_ADMIN_NEEDS_ALTER -11
185#define HA_ADMIN_NEEDS_CHECK -12
186#define HA_ADMIN_STATS_UPD_ERR -13
188#define HA_ADMIN_NEEDS_DUMP_UPGRADE -14
209#define HA_NO_TRANSACTIONS (1 << 0)
210#define HA_PARTIAL_COLUMN_READ (1 << 1)
217#define HA_TABLE_SCAN_ON_INDEX (1 << 2)
220#define HA_UNUSED3 (1 << 3)
227#define HA_CAN_GEOMETRY (1 << 4)
233#define HA_FAST_KEY_READ (1 << 5)
238#define HA_REQUIRES_KEY_COLUMNS_FOR_DELETE (1 << 6)
244#define HA_NULL_IN_KEY (1 << 7)
250#define HA_DUPLICATE_POS (1 << 8)
251#define HA_NO_BLOBS (1 << 9)
256#define HA_CAN_INDEX_BLOBS (1 << 10)
261#define HA_AUTO_PART_KEY (1 << 11)
266#define HA_REQUIRE_PRIMARY_KEY (1 << 12)
271#define HA_STATS_RECORDS_IS_EXACT (1 << 13)
273#define HA_UNUSED14 (1 << 14)
280#define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15)
288#define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16)
289#define HA_CAN_RTREEKEYS (1 << 17)
296#define HA_PRIMARY_KEY_REQUIRED_FOR_DELETE (1 << 19)
300#define HA_NO_PREFIX_CHAR_KEYS (1 << 20)
304#define HA_CAN_FULLTEXT (1 << 21)
309#define HA_CAN_SQL_HANDLER (1 << 22)
313#define HA_NO_AUTO_INCREMENT (1 << 23)
317#define HA_HAS_CHECKSUM (1 << 24)
323#define HA_FILE_BASED (1 << 26)
324#define HA_NO_VARCHAR (1 << 27)
328#define HA_CAN_BIT_FIELD (1 << 28)
329#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
330#define HA_NO_COPY_ON_ALTER (1LL << 31)
331#define HA_COUNT_ROWS_INSTANT (1LL << 32)
333#define HA_HAS_OWN_BINLOGGING (1LL << 33)
338#define HA_BINLOG_ROW_CAPABLE (1LL << 34)
339#define HA_BINLOG_STMT_CAPABLE (1LL << 35)
362#define HA_DUPLICATE_KEY_NOT_IN_ORDER (1LL << 36)
368#define HA_CAN_REPAIR (1LL << 37)
374#define HA_BINLOG_FLAGS (HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE)
410#define HA_READ_BEFORE_WRITE_REMOVAL (1LL << 38)
415#define HA_CAN_FULLTEXT_EXT (1LL << 39)
423#define HA_READ_OUT_OF_SYNC (1LL << 40)
429#define HA_CAN_EXPORT (1LL << 41)
435#define HA_BLOCK_CONST_TABLE (1LL << 42)
440#define HA_CAN_FULLTEXT_HINTS (1LL << 43)
448#define HA_NO_READ_LOCAL_LOCK (1LL << 44)
461#define HA_ATTACHABLE_TRX_COMPATIBLE (1LL << 45)
466#define HA_GENERATED_COLUMNS (1LL << 46)
471#define HA_CAN_INDEX_VIRTUAL_GENERATED_COLUMN (1LL << 47)
476#define HA_DESCENDING_INDEX (1LL << 48)
481#define HA_BLOB_PARTIAL_UPDATE (1LL << 49)
488#define HA_SUPPORTS_GEOGRAPHIC_GEOMETRY_COLUMN (1LL << 50)
493#define HA_SUPPORTS_DEFAULT_EXPRESSION (1LL << 51)
498#define HA_UPDATE_NOT_SUPPORTED (1LL << 52)
503#define HA_DELETE_NOT_SUPPORTED (1LL << 53)
509#define HA_NO_INDEX_ACCESS (1LL << 54)
514#define HA_MULTI_VALUED_KEY_SUPPORT (1LL << 55)
525#define HA_READ_NEXT 1
529#define HA_READ_PREV 2
541#define HA_READ_ORDER 4
548#define HA_READ_RANGE 8
553#define HA_ONLY_WHOLE_INDEX 16
560#define HA_TABLE_SCAN_ON_NULL 32
570#define HA_KEYREAD_ONLY 64
575#define HA_KEY_SCAN_NOT_ROR 128
576#define HA_DO_INDEX_COND_PUSHDOWN 256
579#define HA_KEY_SWITCH_NONUNIQ 0
580#define HA_KEY_SWITCH_ALL 1
581#define HA_KEY_SWITCH_NONUNIQ_SAVE 2
582#define HA_KEY_SWITCH_ALL_SAVE 3
589#define HA_SLOT_UNDEF ((uint)-1)
596#define HA_OPEN_KEYFILE 1
597#define HA_OPEN_RNDFILE 2
598#define HA_GET_INDEX 4
600#define HA_READ_ONLY 16
602#define HA_TRY_READ_ONLY 32
603#define HA_WAIT_IF_LOCKED 64
604#define HA_ABORT_IF_LOCKED 128
605#define HA_BLOCK_LOCK 256
606#define HA_OPEN_TEMPORARY 512
609#define HA_KEY_NULL_LENGTH 1
610#define HA_KEY_BLOB_LENGTH 2
612#define HA_LEX_CREATE_TMP_TABLE 1
613#define HA_LEX_CREATE_IF_NOT_EXISTS 2
614#define HA_LEX_CREATE_TABLE_LIKE 4
615#define HA_LEX_CREATE_INTERNAL_TMP_TABLE 8
616#define HA_MAX_REC_LENGTH 65535U
708#define HA_CREATE_USED_AUTO (1L << 0)
709#define HA_CREATE_USED_RAID (1L << 1)
710#define HA_CREATE_USED_UNION (1L << 2)
711#define HA_CREATE_USED_INSERT_METHOD (1L << 3)
712#define HA_CREATE_USED_MIN_ROWS (1L << 4)
713#define HA_CREATE_USED_MAX_ROWS (1L << 5)
714#define HA_CREATE_USED_AVG_ROW_LENGTH (1L << 6)
715#define HA_CREATE_USED_PACK_KEYS (1L << 7)
716#define HA_CREATE_USED_CHARSET (1L << 8)
717#define HA_CREATE_USED_DEFAULT_CHARSET (1L << 9)
718#define HA_CREATE_USED_DATADIR (1L << 10)
719#define HA_CREATE_USED_INDEXDIR (1L << 11)
720#define HA_CREATE_USED_ENGINE (1L << 12)
721#define HA_CREATE_USED_CHECKSUM (1L << 13)
722#define HA_CREATE_USED_DELAY_KEY_WRITE (1L << 14)
723#define HA_CREATE_USED_ROW_FORMAT (1L << 15)
724#define HA_CREATE_USED_COMMENT (1L << 16)
725#define HA_CREATE_USED_PASSWORD (1L << 17)
726#define HA_CREATE_USED_CONNECTION (1L << 18)
727#define HA_CREATE_USED_KEY_BLOCK_SIZE (1L << 19)
729#define HA_CREATE_USED_TRANSACTIONAL (1L << 20)
731#define HA_CREATE_USED_PAGE_CHECKSUM (1L << 21)
737#define HA_CREATE_USED_STATS_PERSISTENT (1L << 22)
744#define HA_CREATE_USED_STATS_AUTO_RECALC (1L << 23)
751#define HA_CREATE_USED_STATS_SAMPLE_PAGES (1L << 24)
756#define HA_CREATE_USED_TABLESPACE (1L << 25)
759#define HA_CREATE_USED_COMPRESS (1L << 26)
762#define HA_CREATE_USED_ENCRYPT (1L << 27)
769#define HA_CREATE_USED_DEFAULT_COLLATE (1L << 28)
772#define HA_CREATE_USED_SECONDARY_ENGINE (1L << 29)
779#define HA_CREATE_USED_DEFAULT_ENCRYPTION (1L << 30)
816#define MAXGTRIDSIZE 64
817#define MAXBQUALSIZE 64
819#define COMPATIBLE_DATA_YES 0
820#define COMPATIBLE_DATA_NO 1
826#define UNDEF_NODEGROUP 65535
905 const char *datafile,
const char *undofile,
1092 if (lenp !=
nullptr) {
1243 std::unordered_set<my_xid, std::hash<my_xid>, std::equal_to<my_xid>,
1252 using pair = std::pair<const XID, enum_ha_recover_xa_state>;
1254 using list = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1256 using iterator = std::map<XID, enum_ha_recover_xa_state, std::less<XID>,
1259 std::unique_ptr<MEM_ROOT>, std::unique_ptr<Xa_state_list::allocator>,
1260 std::unique_ptr<Xa_state_list::list>, std::unique_ptr<Xa_state_list>>;
1517 const char *tablespace_name);
1562typedef const char *(*get_tablespace_filename_ext_t)();
1660 const char *
name,
uchar **frmblob,
size_t *frmlen);
1663 const char *
path,
const char *wild,
bool dir,
1667 const char *
db,
const char *
name);
1705 bool is_sql_layer_system_table);
1777 const void *sdi,
uint64 sdi_len);
1855 void **ptr_trx_arg);
2053 const char *old_db_name,
2054 const char *old_table_name,
2055 const char *new_db_name,
2056 const char *new_table_name);
2137 uint index_ordinal_position,
uint column_ordinal_position,
2156 const char *tablespace_name,
const char *
file_name,
2199 uint loc_len,
uint task_id,
int in_err,
2211 uint loc_len,
uint task_id,
int in_err);
2225 const char *data_dir);
2237 uint loc_len,
uint task_id,
int in_err,
2249 uint loc_len,
uint task_id,
int in_err);
2373 double optimizer_cost,
2374 bool *use_best_so_far,
2376 double *secondary_engine_cost);
2455template <
typename... Args>
2458 return (uint64_t{1} <<
static_cast<int>(flag1)) |
2541 void *cbk_ctx, uint64_t *start_id,
2565 uint64_t *num_pages);
2571 void (*)(std::vector<std::pair<uint64_t, bool>> &
status);
2818#define HTON_NO_FLAGS 0
2819#define HTON_CLOSE_CURSORS_AT_COMMIT (1 << 0)
2820#define HTON_ALTER_NOT_SUPPORTED (1 << 1)
2821#define HTON_CAN_RECREATE (1 << 2)
2822#define HTON_HIDDEN (1 << 3)
2827#define HTON_NOT_USER_SELECTABLE (1 << 5)
2828#define HTON_TEMPORARY_NOT_SUPPORTED \
2830#define HTON_SUPPORT_LOG_TABLES (1 << 7)
2831#define HTON_NO_PARTITION (1 << 8)
2846#define HTON_NO_BINLOG_ROW_OPT (1 << 9)
2856#define HTON_SUPPORTS_EXTENDED_KEYS (1 << 10)
2860#define HTON_SUPPORTS_FOREIGN_KEYS (1 << 11)
2868#define HTON_SUPPORTS_ATOMIC_DDL (1 << 12)
2871#define HTON_SUPPORTS_PACKED_KEYS (1 << 13)
2874#define HTON_IS_SECONDARY_ENGINE (1 << 14)
2877#define HTON_SUPPORTS_SECONDARY_ENGINE (1 << 15)
2880#define HTON_SUPPORTS_TABLE_ENCRYPTION (1 << 16)
2886constexpr const decltype(
2891#define HTON_SECONDARY_ENGINE_SUPPORTS_DDL (1 << 19)
2894#define HTON_NO_TRIGGER_SUPPORT (1 << 20)
2902#define HTON_SUPPORTS_EXTERNAL_SOURCE (1 << 21)
3135 [[maybe_unused]]) {}
3503 Alter_info *alter_info_arg,
bool error_if_not_empty_arg,
3504 KEY *key_info_arg,
uint key_count_arg,
3540 const char *try_instead);
3548 (
"index renamed: '%s' to '%s'", old_key->
name, new_key->
name));
3556 DBUG_PRINT(
"info", (
"index had visibility altered: %i to %i",
3741 return other > *
this ? true :
false;
3777#define HA_MRR_SINGLE_POINT 1
3778#define HA_MRR_FIXED_KEY 2
3784#define HA_MRR_NO_ASSOCIATION 4
3794#define HA_MRR_SORTED 8
3797#define HA_MRR_INDEX_ONLY 16
3803#define HA_MRR_LIMITS 32
3811#define HA_MRR_USE_DEFAULT_IMPL 64
3818#define HA_MRR_NO_NULL_ENDPOINTS 128
3826#define HA_MRR_SUPPORT_SORTED 256
3899#define make_keypart_map(N) (((key_part_map)2 << (N)) - 1)
3904#define make_prev_keypart_map(N) (((key_part_map)1 << (N)) - 1)
4621 DBUG_PRINT(
"info", (
"handler created F_UNLCK %d F_RDLCK %d F_WRLCK %d",
4622 F_UNLCK, F_RDLCK, F_WRLCK));
4626 assert(
m_psi ==
nullptr);
4738 uint *dup_key_found);
4758 bool error_if_not_loaded);
4774 size_t *num_threads [[maybe_unused]],
4775 bool use_reserved_threads [[maybe_unused]]) {
4799 void *cookie, ulong ncols, ulong row_len,
const ulong *col_offsets,
4800 const ulong *null_byte_offsets,
const ulong *null_bitmasks)>;
4814 using Load_cbk = std::function<bool(
void *cookie,
uint nrows,
void *rowdata,
4815 uint64_t partition_id)>;
4838 void **thread_ctxs [[maybe_unused]],
4893 uint child_table_name_len,
4894 char *child_key_name,
4895 uint child_key_name_len);