MySQL 8.4.3
Source Code Documentation
my_base.h File Reference

This file includes constants used by all storage engines. More...

#include <limits.h>
#include <sys/types.h>
#include "my_config.h"
#include "my_double2ulonglong.h"
#include "my_inttypes.h"
#include "my_macros.h"

Go to the source code of this file.

Classes

struct  key_range
 
struct  KEY_MULTI_RANGE
 

Macros

#define HA_OPEN_ABORT_IF_LOCKED   0 /* default */
 
#define HA_OPEN_WAIT_IF_LOCKED   1
 
#define HA_OPEN_IGNORE_IF_LOCKED   2
 
#define HA_OPEN_TMP_TABLE   4 /* Table is a temp table */
 
#define HA_OPEN_DELAY_KEY_WRITE   8 /* Don't update index */
 
#define HA_OPEN_ABORT_IF_CRASHED   16
 
#define HA_OPEN_FOR_REPAIR   32 /* open even if crashed */
 
#define HA_OPEN_FROM_SQL_LAYER   64
 
#define HA_OPEN_COPY   256 /* Open copy (for repair) */
 
#define HA_OPEN_INTERNAL_TABLE   512
 Internal temp table, used for temporary results; one or more instance of it may be be created. More...
 
#define HA_EXTRA_PREPARE_FOR_DELETE   HA_EXTRA_PREPARE_FOR_DROP
 
#define HA_MAX_KEYTYPE   31 /* Must be log2-1 */
 
#define HA_NOSAME   1
 Do not allow duplicate records. More...
 
#define HA_PACK_KEY   (1 << 1)
 Pack string key to previous key (optimization supported by MyISAM). More...
 
#define HA_SPACE_PACK_USED   (1 << 2)
 Some key part packs space. More...
 
#define HA_VAR_LENGTH_KEY   (1 << 3)
 Some key part has variable length. More...
 
#define HA_AUTO_KEY   (1 << 4)
 Auto-increment key. More...
 
#define HA_BINARY_PACK_KEY   (1 << 5)
 Packing of all keys to previous key (optimization supported by MyISAM). More...
 
#define HA_NULL_PART_KEY   (1 << 6)
 Some key part is nullable. More...
 
#define HA_FULLTEXT   (1 << 7)
 Full-text key. More...
 
#define HA_UNIQUE_CHECK   (1 << 8)
 Flag in MI_KEYDEF::flag which marks MyISAM's "uniques". More...
 
#define HA_SORT_ALLOWS_SAME   (1 << 9)
 Internal bit used when sorting records. More...
 
#define HA_SPATIAL   (1 << 10)
 Spatial key. More...
 
#define HA_NULL_ARE_EQUAL   (1 << 11)
 NULLs in key are compared as equal. More...
 
#define HA_USES_COMMENT   (1 << 12)
 Key has comment. More...
 
#define HA_GENERATED_KEY   (1 << 13)
 Key was automatically created to support Foreign Key constraint. More...
 
#define HA_KEYFLAG_MASK
 
#define HA_USES_PARSER   (1 << 14)
 Fulltext index uses [pre]parser. More...
 
#define HA_USES_BLOCK_SIZE   (1 << 15)
 Key uses KEY_BLOCK_SIZE option. More...
 
#define HA_KEY_HAS_PART_KEY_SEG   (1 << 16)
 Key contains partial segments. More...
 
#define HA_KEY_RENAMED   (1 << 17)
 Key was renamed (or is result of renaming a key). More...
 
#define HA_VIRTUAL_GEN_KEY   (1 << 18)
 Set if a key is on any virtual generated columns. More...
 
#define HA_MULTI_VALUED_KEY   (1 << 19)
 Multi-valued key. More...
 
#define HA_SPACE_PACK   1 /* Pack space in key-seg */
 
#define HA_PART_KEY_SEG   4 /* Used by MySQL for part-key-cols */
 
#define HA_VAR_LENGTH_PART   8
 
#define HA_NULL_PART   16
 
#define HA_BLOB_PART   32
 
#define HA_SWAP_KEY   64
 
#define HA_REVERSE_SORT   128 /* Sort key in reverse order */
 
#define HA_NO_SORT   256 /* do not bother sorting on this keyseg */
 
#define HA_END_SPACE_ARE_EQUAL   512
 
#define HA_BIT_PART   1024
 
#define HA_OPTION_PACK_RECORD   1
 Indicates that storage engine needs to use packed row format. More...
 
#define HA_OPTION_PACK_KEYS   2
 PACK_KEYS=1 option was specified. More...
 
#define HA_OPTION_COMPRESS_RECORD   4
 Flag indicating that table is compressed. More...
 
#define HA_OPTION_UNUSED1   8
 Unused. More...
 
#define HA_OPTION_TMP_TABLE   16
 Storage engine (MyISAM) internal flag for marking temporary tables. More...
 
#define HA_OPTION_CHECKSUM   32
 CHECKSUM=1 option was specified. More...
 
#define HA_OPTION_DELAY_KEY_WRITE   64
 DELAY_KEY_WRITE=1 option was specified. More...
 
#define HA_OPTION_NO_PACK_KEYS   128
 PACK_KEYS=0 option was specified. More...
 
#define HA_OPTION_CREATE_FROM_ENGINE   256
 Flag specific to table creation and HA_CREATE_INFO::table_options. More...
 
#define HA_OPTION_RELIES_ON_SQL_LAYER   512
 Storage engine (MyISAM) internal flag for marking tables which rely on SQL-layer because they have keys using fulltext parser plugin. More...
 
#define HA_OPTION_UNUSED2   1024
 Unused. More...
 
#define HA_OPTION_UNUSED3   2048
 Unused. More...
 
#define HA_OPTION_STATS_PERSISTENT   4096
 STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE or ALTER TABLE). More...
 
#define HA_OPTION_NO_STATS_PERSISTENT   8192
 STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE. More...
 
#define HA_OPTION_TEMP_COMPRESS_RECORD   16384
 MyISAM internal flag used by myisamchk external tool. More...
 
#define HA_OPTION_READ_ONLY_DATA   32768
 MyISAM internal flag which marks table as read-only. More...
 
#define HA_OPTION_NO_CHECKSUM   (1L << 17)
 CHECKSUM=0 option was specified. More...
 
#define HA_OPTION_NO_DELAY_KEY_WRITE   (1L << 18)
 DELAY_KEY_WRITE=0 option was specified. More...
 
#define HA_DONT_TOUCH_DATA   1 /* Don't empty datafile (isamchk) */
 
#define HA_PACK_RECORD   2 /* Request packed record format */
 
#define HA_CREATE_TMP_TABLE   4
 
#define HA_CREATE_CHECKSUM   8
 
#define HA_CREATE_KEEP_FILES   16 /* don't overwrite .MYD and MYI */
 
#define HA_CREATE_PAGE_CHECKSUM   32
 
#define HA_CREATE_DELAY_KEY_WRITE   64
 
#define HA_CREATE_RELIES_ON_SQL_LAYER   128
 
#define HA_CREATE_INTERNAL_TABLE   256
 
#define HA_STATUS_POS   1
 
#define HA_STATUS_NO_LOCK   2
 
#define HA_STATUS_TIME   4
 
#define HA_STATUS_CONST   8
 
#define HA_STATUS_VARIABLE   16
 
#define HA_STATUS_ERRKEY   32
 
#define HA_STATUS_AUTO   64
 
#define HA_STATUS_VARIABLE_EXTRA   128
 
#define HA_ERR_FIRST   120
 Copy of first error nr. More...
 
#define HA_ERR_KEY_NOT_FOUND   120
 Didn't find key on read or update. More...
 
#define HA_ERR_FOUND_DUPP_KEY   121
 Duplicate key on write. More...
 
#define HA_ERR_INTERNAL_ERROR   122
 Internal error. More...
 
#define HA_ERR_RECORD_CHANGED   123
 Uppdate with is recoverable. More...
 
#define HA_ERR_WRONG_INDEX   124
 Wrong index given to function. More...
 
#define HA_ERR_ROLLED_BACK   125
 Transaction has been rolled back. More...
 
#define HA_ERR_CRASHED   126
 Indexfile is crashed. More...
 
#define HA_ERR_WRONG_IN_RECORD   127
 Record-file is crashed. More...
 
#define HA_ERR_OUT_OF_MEM   128
 Record-file is crashed. More...
 
#define HA_ERR_NOT_A_TABLE   130
 not a MYI file - no signature More...
 
#define HA_ERR_WRONG_COMMAND   131
 Command not supported. More...
 
#define HA_ERR_OLD_FILE   132
 old database file More...
 
#define HA_ERR_NO_ACTIVE_RECORD   133
 No record read in update() More...
 
#define HA_ERR_RECORD_DELETED   134
 A record is not there. More...
 
#define HA_ERR_RECORD_FILE_FULL   135
 No more room in file. More...
 
#define HA_ERR_INDEX_FILE_FULL   136
 No more room in file. More...
 
#define HA_ERR_END_OF_FILE   137
 end in next/prev/first/last More...
 
#define HA_ERR_UNSUPPORTED   138
 unsupported extension used More...
 
#define HA_ERR_TOO_BIG_ROW   139
 Too big row. More...
 
#define HA_WRONG_CREATE_OPTION   140
 Wrong create option. More...
 
#define HA_ERR_FOUND_DUPP_UNIQUE   141
 Duplicate unique on write. More...
 
#define HA_ERR_UNKNOWN_CHARSET   142
 Can't open charset. More...
 
#define HA_ERR_WRONG_MRG_TABLE_DEF   143
 conflicting tables in MERGE More...
 
#define HA_ERR_CRASHED_ON_REPAIR   144
 Last (automatic?) repair failed. More...
 
#define HA_ERR_CRASHED_ON_USAGE   145
 Table must be repaired. More...
 
#define HA_ERR_LOCK_WAIT_TIMEOUT   146
 
#define HA_ERR_LOCK_TABLE_FULL   147
 
#define HA_ERR_READ_ONLY_TRANSACTION   148
 Updates not allowed. More...
 
#define HA_ERR_LOCK_DEADLOCK   149
 
#define HA_ERR_CANNOT_ADD_FOREIGN   150
 Cannot add a foreign key constr. More...
 
#define HA_ERR_NO_REFERENCED_ROW   151
 Cannot add a child row. More...
 
#define HA_ERR_ROW_IS_REFERENCED   152
 Cannot delete a parent row. More...
 
#define HA_ERR_NO_SAVEPOINT   153
 No savepoint with that name. More...
 
#define HA_ERR_NON_UNIQUE_BLOCK_SIZE   154
 Non unique key block size. More...
 
#define HA_ERR_NO_SUCH_TABLE   155
 The table does not exist in engine. More...
 
#define HA_ERR_TABLE_EXIST   156
 The table existed in storage engine. More...
 
#define HA_ERR_NO_CONNECTION   157
 Could not connect to storage engine. More...
 
#define HA_ERR_NULL_IN_SPATIAL   158
 NULLs are not supported in spatial index. More...
 
#define HA_ERR_TABLE_DEF_CHANGED   159
 The table changed in storage engine. More...
 
#define HA_ERR_NO_PARTITION_FOUND   160
 There's no partition in table for given value. More...
 
#define HA_ERR_RBR_LOGGING_FAILED   161
 Row-based binlogging of row failed. More...
 
#define HA_ERR_DROP_INDEX_FK   162
 Index needed in foreign key constraint. More...
 
#define HA_ERR_FOREIGN_DUPLICATE_KEY   163
 Upholding foreign key constraints would lead to a duplicate key error in some other table. More...
 
#define HA_ERR_TABLE_NEEDS_UPGRADE   164
 The table changed in storage engine. More...
 
#define HA_ERR_TABLE_READONLY   165
 The table is not writable. More...
 
#define HA_ERR_AUTOINC_READ_FAILED   166
 Failed to get next autoinc value. More...
 
#define HA_ERR_AUTOINC_ERANGE   167
 Failed to set row autoinc value. More...
 
#define HA_ERR_GENERIC   168
 Generic error. More...
 
#define HA_ERR_RECORD_IS_THE_SAME   169
 row not actually updated: new values same as the old values More...
 
#define HA_ERR_LOGGING_IMPOSSIBLE   170
 It is not possible to log this statement. More...
 
#define HA_ERR_CORRUPT_EVENT   171
 The event was corrupt, leading to illegal data being read. More...
 
#define HA_ERR_NEW_FILE   172
 New file format. More...
 
#define HA_ERR_ROWS_EVENT_APPLY   173
 The event could not be processed no other handler error happened. More...
 
#define HA_ERR_INITIALIZATION   174
 Error during initialization. More...
 
#define HA_ERR_FILE_TOO_SHORT   175
 File too short. More...
 
#define HA_ERR_WRONG_CRC   176
 Wrong CRC on page. More...
 
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS   177
 Too many active concurrent transactions. More...
 
#define HA_ERR_NOT_IN_LOCK_PARTITIONS   178
 There's no explicitly listed partition in table for the given value. More...
 
#define HA_ERR_INDEX_COL_TOO_LONG   179
 Index column length exceeds limit. More...
 
#define HA_ERR_INDEX_CORRUPT   180
 InnoDB index corrupted. More...
 
#define HA_ERR_UNDO_REC_TOO_BIG   181
 Undo log record too big. More...
 
#define HA_FTS_INVALID_DOCID   182
 Invalid InnoDB Doc ID. More...
 
#define HA_ERR_TABLE_IN_FK_CHECK   183
 Table being used in foreign key check. More...
 
#define HA_ERR_TABLESPACE_EXISTS   184
 The tablespace existed in storage engine. More...
 
#define HA_ERR_TOO_MANY_FIELDS   185
 Table has too many columns. More...
 
#define HA_ERR_ROW_IN_WRONG_PARTITION   186
 Row in wrong partition. More...
 
#define HA_ERR_INNODB_READ_ONLY   187
 InnoDB is in read only mode. More...
 
#define HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT   188
 FTS query exceeds result cache limit. More...
 
#define HA_ERR_TEMP_FILE_WRITE_FAILURE   189
 Temporary file write failure. More...
 
#define HA_ERR_INNODB_FORCED_RECOVERY   190
 Innodb is in force recovery mode. More...
 
#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE   191
 Too many words in a phrase. More...
 
#define HA_ERR_FK_DEPTH_EXCEEDED   192
 FK cascade depth exceeded. More...
 
#define HA_MISSING_CREATE_OPTION   193
 Option Missing during Create. More...
 
#define HA_ERR_SE_OUT_OF_MEMORY   194
 Out of memory in storage engine. More...
 
#define HA_ERR_TABLE_CORRUPT   195
 Table/Clustered index is corrupted. More...
 
#define HA_ERR_QUERY_INTERRUPTED   196
 The query was interrupted. More...
 
#define HA_ERR_TABLESPACE_MISSING   197
 Missing Tablespace. More...
 
#define HA_ERR_TABLESPACE_IS_NOT_EMPTY   198
 Tablespace is not empty. More...
 
#define HA_ERR_WRONG_FILE_NAME   199
 Invalid Filename. More...
 
#define HA_ERR_NOT_ALLOWED_COMMAND   200
 Operation is not allowed. More...
 
#define HA_ERR_COMPUTE_FAILED   201
 Compute generated column value failed. More...
 
#define HA_ERR_ROW_FORMAT_CHANGED   202
 Table's row format has changed in the storage engine. More...
 
#define HA_ERR_NO_WAIT_LOCK   203
 Don't wait for record lock. More...
 
#define HA_ERR_DISK_FULL_NOWAIT   204
 No more room in disk. More...
 
#define HA_ERR_NO_SESSION_TEMP   205
 No session temporary space available. More...
 
#define HA_ERR_WRONG_TABLE_NAME   206
 Wrong or Invalid table name. More...
 
#define HA_ERR_TOO_LONG_PATH   207
 Path is too long for the OS. More...
 
#define HA_ERR_SAMPLING_INIT_FAILED   208
 Histogram sampling initialization failed. More...
 
#define HA_ERR_FTS_TOO_MANY_NESTED_EXP   209
 Too many sub-expression in search string. More...
 
#define HA_ERR_LAST   209
 Copy of last error number. More...
 
#define HA_ERR_ERRORS   (HA_ERR_LAST - HA_ERR_FIRST + 1)
 
#define HA_NAMELEN   64 /* Max length of saved filename */
 
#define NO_SUCH_KEY   (~(uint)0) /* used as a key no. */
 
#define HA_WHOLE_KEY   (~(key_part_map)0)
 
#define SEARCH_FIND   1
 
#define SEARCH_NO_FIND   2
 
#define SEARCH_SAME   4
 
#define SEARCH_BIGGER   8
 
#define SEARCH_SMALLER   16
 
#define SEARCH_SAVE_BUFF   32
 
#define SEARCH_UPDATE   64
 
#define SEARCH_PREFIX   128
 
#define SEARCH_LAST   256
 
#define MBR_CONTAIN   512
 
#define MBR_INTERSECT   1024
 
#define MBR_WITHIN   2048
 
#define MBR_DISJOINT   4096
 
#define MBR_EQUAL   8192
 
#define MBR_DATA   16384
 
#define SEARCH_NULL_ARE_EQUAL   32768 /* NULL in keys are equal */
 
#define SEARCH_NULL_ARE_NOT_EQUAL   65536 /* NULL in keys are not equal */
 
#define QUICK_USED   1
 
#define READ_CACHE_USED   2
 
#define READ_CHECK_USED   4
 
#define KEY_READ_USED   8
 
#define WRITE_CACHE_USED   16
 
#define OPT_NO_ROWS   32
 
#define HA_STATE_CHANGED   1 /* Database has changed */
 
#define HA_STATE_AKTIV   2 /* Has a current record */
 
#define HA_STATE_WRITTEN   4 /* Record is written */
 
#define HA_STATE_DELETED   8
 
#define HA_STATE_NEXT_FOUND   16 /* Next found record (record before) */
 
#define HA_STATE_PREV_FOUND   32 /* Prev found record (record after) */
 
#define HA_STATE_NO_KEY   64 /* Last read didn't find record */
 
#define HA_STATE_KEY_CHANGED   128
 
#define HA_STATE_WRITE_AT_END   256 /* set in _ps_find_writepos */
 
#define HA_STATE_BUFF_SAVED   512 /* If current keybuff is info->buff */
 
#define HA_STATE_ROW_CHANGED   1024 /* To invalidate ROW cache */
 
#define HA_STATE_EXTEND_BLOCK   2048
 
#define rows2double(A)   ulonglong2double(A)
 
#define HA_POS_ERROR   (~(ha_rows)0)
 
#define HA_OFFSET_ERROR   (~(my_off_t)0)
 
#define MAX_FILE_SIZE   LLONG_MAX
 
#define HA_VARCHAR_PACKLENGTH(field_length)   ((field_length) < 256 ? 1 : 2)
 

Typedefs

typedef ulong key_part_map
 
typedef my_off_t ha_rows
 

Enumerations

enum  ha_rkey_function {
  HA_READ_KEY_EXACT , HA_READ_KEY_OR_NEXT , HA_READ_KEY_OR_PREV , HA_READ_AFTER_KEY ,
  HA_READ_BEFORE_KEY , HA_READ_PREFIX , HA_READ_PREFIX_LAST , HA_READ_PREFIX_LAST_OR_PREV ,
  HA_READ_MBR_CONTAIN , HA_READ_MBR_INTERSECT , HA_READ_MBR_WITHIN , HA_READ_MBR_DISJOINT ,
  HA_READ_MBR_EQUAL , HA_READ_NEAREST_NEIGHBOR , HA_READ_INVALID = -1
}
 
enum  ha_key_alg {
  HA_KEY_ALG_SE_SPECIFIC = 0 , HA_KEY_ALG_BTREE = 1 , HA_KEY_ALG_RTREE = 2 , HA_KEY_ALG_HASH = 3 ,
  HA_KEY_ALG_FULLTEXT = 4
}
 
enum  ha_storage_media { HA_SM_DEFAULT = 0 , HA_SM_DISK = 1 , HA_SM_MEMORY = 2 }
 
enum  ha_extra_function {
  HA_EXTRA_NORMAL = 0 , HA_EXTRA_QUICK = 1 , HA_EXTRA_NOT_USED = 2 , HA_EXTRA_NO_READCHECK = 5 ,
  HA_EXTRA_READCHECK = 6 , HA_EXTRA_KEYREAD = 7 , HA_EXTRA_NO_KEYREAD = 8 , HA_EXTRA_NO_USER_CHANGE = 9 ,
  HA_EXTRA_WAIT_LOCK = 12 , HA_EXTRA_NO_WAIT_LOCK = 13 , HA_EXTRA_NO_KEYS = 16 , HA_EXTRA_KEYREAD_CHANGE_POS = 17 ,
  HA_EXTRA_REMEMBER_POS = 18 , HA_EXTRA_RESTORE_POS = 19 , HA_EXTRA_FORCE_REOPEN = 21 , HA_EXTRA_FLUSH ,
  HA_EXTRA_NO_ROWS , HA_EXTRA_RESET_STATE , HA_EXTRA_IGNORE_DUP_KEY , HA_EXTRA_NO_IGNORE_DUP_KEY ,
  HA_EXTRA_PREPARE_FOR_DROP , HA_EXTRA_PREPARE_FOR_UPDATE , HA_EXTRA_PRELOAD_BUFFER_SIZE , HA_EXTRA_CHANGE_KEY_TO_UNIQUE ,
  HA_EXTRA_CHANGE_KEY_TO_DUP , HA_EXTRA_KEYREAD_PRESERVE_FIELDS , HA_EXTRA_IGNORE_NO_KEY , HA_EXTRA_NO_IGNORE_NO_KEY ,
  HA_EXTRA_MARK_AS_LOG_TABLE , HA_EXTRA_WRITE_CAN_REPLACE , HA_EXTRA_WRITE_CANNOT_REPLACE , HA_EXTRA_DELETE_CANNOT_BATCH ,
  HA_EXTRA_UPDATE_CANNOT_BATCH , HA_EXTRA_INSERT_WITH_UPDATE , HA_EXTRA_PREPARE_FOR_RENAME , HA_EXTRA_ADD_CHILDREN_LIST ,
  HA_EXTRA_ATTACH_CHILDREN , HA_EXTRA_IS_ATTACHED_CHILDREN , HA_EXTRA_DETACH_CHILDREN , HA_EXTRA_EXPORT ,
  HA_EXTRA_SECONDARY_SORT_ROWID , HA_EXTRA_NO_READ_LOCKING , HA_EXTRA_BEGIN_ALTER_COPY , HA_EXTRA_END_ALTER_COPY ,
  HA_EXTRA_NO_AUTOINC_LOCKING , HA_EXTRA_ENABLE_UNIQUE_RECORD_FILTER , HA_EXTRA_DISABLE_UNIQUE_RECORD_FILTER
}
 
enum  ha_panic_function { HA_PANIC_CLOSE , HA_PANIC_WRITE , HA_PANIC_READ }
 
enum  ha_base_keytype {
  HA_KEYTYPE_END = 0 , HA_KEYTYPE_TEXT = 1 , HA_KEYTYPE_BINARY = 2 , HA_KEYTYPE_SHORT_INT = 3 ,
  HA_KEYTYPE_LONG_INT = 4 , HA_KEYTYPE_FLOAT = 5 , HA_KEYTYPE_DOUBLE = 6 , HA_KEYTYPE_NUM = 7 ,
  HA_KEYTYPE_USHORT_INT = 8 , HA_KEYTYPE_ULONG_INT = 9 , HA_KEYTYPE_LONGLONG = 10 , HA_KEYTYPE_ULONGLONG = 11 ,
  HA_KEYTYPE_INT24 = 12 , HA_KEYTYPE_UINT24 = 13 , HA_KEYTYPE_INT8 = 14 , HA_KEYTYPE_VARTEXT1 = 15 ,
  HA_KEYTYPE_VARBINARY1 = 16 , HA_KEYTYPE_VARTEXT2 = 17 , HA_KEYTYPE_VARBINARY2 = 18 , HA_KEYTYPE_BIT = 19
}
 
enum  en_fieldtype {
  FIELD_LAST = -1 , FIELD_NORMAL , FIELD_SKIP_ENDSPACE , FIELD_SKIP_PRESPACE ,
  FIELD_SKIP_ZERO , FIELD_BLOB , FIELD_CONSTANT , FIELD_INTERVALL ,
  FIELD_ZERO , FIELD_VARCHAR , FIELD_CHECK , FIELD_enum_val_count
}
 
enum  data_file_type { STATIC_RECORD , DYNAMIC_RECORD , COMPRESSED_RECORD , BLOCK_RECORD }
 
enum  key_range_flags {
  NO_MIN_RANGE = 1 << 0 , NO_MAX_RANGE = 1 << 1 , NEAR_MIN = 1 << 2 , NEAR_MAX = 1 << 3 ,
  UNIQUE_RANGE = 1 << 4 , EQ_RANGE = 1 << 5 , NULL_RANGE = 1 << 6 , GEOM_FLAG = 1 << 7 ,
  SKIP_RANGE = 1 << 8 , SKIP_RECORDS_IN_RANGE = 1 << 9 , DESC_FLAG = 1 << 10
}
 

Variables

constexpr const ulong HA_INDEX_USES_ENGINE_ATTRIBUTE {1UL << 20}
 
constexpr const ulong HA_INDEX_USES_SECONDARY_ENGINE_ATTRIBUTE {1UL << 21}
 

Detailed Description

This file includes constants used by all storage engines.

Macro Definition Documentation

◆ HA_AUTO_KEY

#define HA_AUTO_KEY   (1 << 4)

Auto-increment key.

Note
Not used by SQL-layer/ for KEY::flags. Only set by MyISAM and Heap SEs in MI/HP_KEYDEFflag.

◆ HA_BINARY_PACK_KEY

#define HA_BINARY_PACK_KEY   (1 << 5)

Packing of all keys to previous key (optimization supported by MyISAM).

◆ HA_BIT_PART

#define HA_BIT_PART   1024

◆ HA_BLOB_PART

#define HA_BLOB_PART   32

◆ HA_CREATE_CHECKSUM

#define HA_CREATE_CHECKSUM   8

◆ HA_CREATE_DELAY_KEY_WRITE

#define HA_CREATE_DELAY_KEY_WRITE   64

◆ HA_CREATE_INTERNAL_TABLE

#define HA_CREATE_INTERNAL_TABLE   256

◆ HA_CREATE_KEEP_FILES

#define HA_CREATE_KEEP_FILES   16 /* don't overwrite .MYD and MYI */

◆ HA_CREATE_PAGE_CHECKSUM

#define HA_CREATE_PAGE_CHECKSUM   32

◆ HA_CREATE_RELIES_ON_SQL_LAYER

#define HA_CREATE_RELIES_ON_SQL_LAYER   128

◆ HA_CREATE_TMP_TABLE

#define HA_CREATE_TMP_TABLE   4

◆ HA_DONT_TOUCH_DATA

#define HA_DONT_TOUCH_DATA   1 /* Don't empty datafile (isamchk) */

◆ HA_END_SPACE_ARE_EQUAL

#define HA_END_SPACE_ARE_EQUAL   512

◆ HA_ERR_AUTOINC_ERANGE

#define HA_ERR_AUTOINC_ERANGE   167

Failed to set row autoinc value.

◆ HA_ERR_AUTOINC_READ_FAILED

#define HA_ERR_AUTOINC_READ_FAILED   166

Failed to get next autoinc value.

◆ HA_ERR_CANNOT_ADD_FOREIGN

#define HA_ERR_CANNOT_ADD_FOREIGN   150

Cannot add a foreign key constr.

◆ HA_ERR_COMPUTE_FAILED

#define HA_ERR_COMPUTE_FAILED   201

Compute generated column value failed.

◆ HA_ERR_CORRUPT_EVENT

#define HA_ERR_CORRUPT_EVENT   171

The event was corrupt, leading to illegal data being read.

◆ HA_ERR_CRASHED

#define HA_ERR_CRASHED   126

Indexfile is crashed.

◆ HA_ERR_CRASHED_ON_REPAIR

#define HA_ERR_CRASHED_ON_REPAIR   144

Last (automatic?) repair failed.

◆ HA_ERR_CRASHED_ON_USAGE

#define HA_ERR_CRASHED_ON_USAGE   145

Table must be repaired.

◆ HA_ERR_DISK_FULL_NOWAIT

#define HA_ERR_DISK_FULL_NOWAIT   204

No more room in disk.

◆ HA_ERR_DROP_INDEX_FK

#define HA_ERR_DROP_INDEX_FK   162

Index needed in foreign key constraint.

◆ HA_ERR_END_OF_FILE

#define HA_ERR_END_OF_FILE   137

end in next/prev/first/last

◆ HA_ERR_ERRORS

#define HA_ERR_ERRORS   (HA_ERR_LAST - HA_ERR_FIRST + 1)

◆ HA_ERR_FILE_TOO_SHORT

#define HA_ERR_FILE_TOO_SHORT   175

File too short.

◆ HA_ERR_FIRST

#define HA_ERR_FIRST   120

Copy of first error nr.

◆ HA_ERR_FK_DEPTH_EXCEEDED

#define HA_ERR_FK_DEPTH_EXCEEDED   192

FK cascade depth exceeded.

◆ HA_ERR_FOREIGN_DUPLICATE_KEY

#define HA_ERR_FOREIGN_DUPLICATE_KEY   163

Upholding foreign key constraints would lead to a duplicate key error in some other table.

◆ HA_ERR_FOUND_DUPP_KEY

#define HA_ERR_FOUND_DUPP_KEY   121

Duplicate key on write.

◆ HA_ERR_FOUND_DUPP_UNIQUE

#define HA_ERR_FOUND_DUPP_UNIQUE   141

Duplicate unique on write.

◆ HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT

#define HA_ERR_FTS_EXCEED_RESULT_CACHE_LIMIT   188

FTS query exceeds result cache limit.

◆ HA_ERR_FTS_TOO_MANY_NESTED_EXP

#define HA_ERR_FTS_TOO_MANY_NESTED_EXP   209

Too many sub-expression in search string.

◆ HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE

#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE   191

Too many words in a phrase.

◆ HA_ERR_GENERIC

#define HA_ERR_GENERIC   168

Generic error.

◆ HA_ERR_INDEX_COL_TOO_LONG

#define HA_ERR_INDEX_COL_TOO_LONG   179

Index column length exceeds limit.

◆ HA_ERR_INDEX_CORRUPT

#define HA_ERR_INDEX_CORRUPT   180

InnoDB index corrupted.

◆ HA_ERR_INDEX_FILE_FULL

#define HA_ERR_INDEX_FILE_FULL   136

No more room in file.

◆ HA_ERR_INITIALIZATION

#define HA_ERR_INITIALIZATION   174

Error during initialization.

◆ HA_ERR_INNODB_FORCED_RECOVERY

#define HA_ERR_INNODB_FORCED_RECOVERY   190

Innodb is in force recovery mode.

◆ HA_ERR_INNODB_READ_ONLY

#define HA_ERR_INNODB_READ_ONLY   187

InnoDB is in read only mode.

◆ HA_ERR_INTERNAL_ERROR

#define HA_ERR_INTERNAL_ERROR   122

Internal error.

◆ HA_ERR_KEY_NOT_FOUND

#define HA_ERR_KEY_NOT_FOUND   120

Didn't find key on read or update.

◆ HA_ERR_LAST

#define HA_ERR_LAST   209

Copy of last error number.

◆ HA_ERR_LOCK_DEADLOCK

#define HA_ERR_LOCK_DEADLOCK   149

◆ HA_ERR_LOCK_TABLE_FULL

#define HA_ERR_LOCK_TABLE_FULL   147

◆ HA_ERR_LOCK_WAIT_TIMEOUT

#define HA_ERR_LOCK_WAIT_TIMEOUT   146

◆ HA_ERR_LOGGING_IMPOSSIBLE

#define HA_ERR_LOGGING_IMPOSSIBLE   170

It is not possible to log this statement.

◆ HA_ERR_NEW_FILE

#define HA_ERR_NEW_FILE   172

New file format.

◆ HA_ERR_NO_ACTIVE_RECORD

#define HA_ERR_NO_ACTIVE_RECORD   133

No record read in update()

◆ HA_ERR_NO_CONNECTION

#define HA_ERR_NO_CONNECTION   157

Could not connect to storage engine.

◆ HA_ERR_NO_PARTITION_FOUND

#define HA_ERR_NO_PARTITION_FOUND   160

There's no partition in table for given value.

◆ HA_ERR_NO_REFERENCED_ROW

#define HA_ERR_NO_REFERENCED_ROW   151

Cannot add a child row.

◆ HA_ERR_NO_SAVEPOINT

#define HA_ERR_NO_SAVEPOINT   153

No savepoint with that name.

◆ HA_ERR_NO_SESSION_TEMP

#define HA_ERR_NO_SESSION_TEMP   205

No session temporary space available.

◆ HA_ERR_NO_SUCH_TABLE

#define HA_ERR_NO_SUCH_TABLE   155

The table does not exist in engine.

◆ HA_ERR_NO_WAIT_LOCK

#define HA_ERR_NO_WAIT_LOCK   203

Don't wait for record lock.

◆ HA_ERR_NON_UNIQUE_BLOCK_SIZE

#define HA_ERR_NON_UNIQUE_BLOCK_SIZE   154

Non unique key block size.

◆ HA_ERR_NOT_A_TABLE

#define HA_ERR_NOT_A_TABLE   130

not a MYI file - no signature

◆ HA_ERR_NOT_ALLOWED_COMMAND

#define HA_ERR_NOT_ALLOWED_COMMAND   200

Operation is not allowed.

◆ HA_ERR_NOT_IN_LOCK_PARTITIONS

#define HA_ERR_NOT_IN_LOCK_PARTITIONS   178

There's no explicitly listed partition in table for the given value.

◆ HA_ERR_NULL_IN_SPATIAL

#define HA_ERR_NULL_IN_SPATIAL   158

NULLs are not supported in spatial index.

◆ HA_ERR_OLD_FILE

#define HA_ERR_OLD_FILE   132

old database file

◆ HA_ERR_OUT_OF_MEM

#define HA_ERR_OUT_OF_MEM   128

Record-file is crashed.

◆ HA_ERR_QUERY_INTERRUPTED

#define HA_ERR_QUERY_INTERRUPTED   196

The query was interrupted.

◆ HA_ERR_RBR_LOGGING_FAILED

#define HA_ERR_RBR_LOGGING_FAILED   161

Row-based binlogging of row failed.

◆ HA_ERR_READ_ONLY_TRANSACTION

#define HA_ERR_READ_ONLY_TRANSACTION   148

Updates not allowed.

◆ HA_ERR_RECORD_CHANGED

#define HA_ERR_RECORD_CHANGED   123

Uppdate with is recoverable.

◆ HA_ERR_RECORD_DELETED

#define HA_ERR_RECORD_DELETED   134

A record is not there.

◆ HA_ERR_RECORD_FILE_FULL

#define HA_ERR_RECORD_FILE_FULL   135

No more room in file.

◆ HA_ERR_RECORD_IS_THE_SAME

#define HA_ERR_RECORD_IS_THE_SAME   169

row not actually updated: new values same as the old values

◆ HA_ERR_ROLLED_BACK

#define HA_ERR_ROLLED_BACK   125

Transaction has been rolled back.

◆ HA_ERR_ROW_FORMAT_CHANGED

#define HA_ERR_ROW_FORMAT_CHANGED   202

Table's row format has changed in the storage engine.

Information in the data-dictionary needs to be updated.

◆ HA_ERR_ROW_IN_WRONG_PARTITION

#define HA_ERR_ROW_IN_WRONG_PARTITION   186

Row in wrong partition.

◆ HA_ERR_ROW_IS_REFERENCED

#define HA_ERR_ROW_IS_REFERENCED   152

Cannot delete a parent row.

◆ HA_ERR_ROWS_EVENT_APPLY

#define HA_ERR_ROWS_EVENT_APPLY   173

The event could not be processed no other handler error happened.

◆ HA_ERR_SAMPLING_INIT_FAILED

#define HA_ERR_SAMPLING_INIT_FAILED   208

Histogram sampling initialization failed.

◆ HA_ERR_SE_OUT_OF_MEMORY

#define HA_ERR_SE_OUT_OF_MEMORY   194

Out of memory in storage engine.

◆ HA_ERR_TABLE_CORRUPT

#define HA_ERR_TABLE_CORRUPT   195

Table/Clustered index is corrupted.

◆ HA_ERR_TABLE_DEF_CHANGED

#define HA_ERR_TABLE_DEF_CHANGED   159

The table changed in storage engine.

◆ HA_ERR_TABLE_EXIST

#define HA_ERR_TABLE_EXIST   156

The table existed in storage engine.

◆ HA_ERR_TABLE_IN_FK_CHECK

#define HA_ERR_TABLE_IN_FK_CHECK   183

Table being used in foreign key check.

◆ HA_ERR_TABLE_NEEDS_UPGRADE

#define HA_ERR_TABLE_NEEDS_UPGRADE   164

The table changed in storage engine.

◆ HA_ERR_TABLE_READONLY

#define HA_ERR_TABLE_READONLY   165

The table is not writable.

◆ HA_ERR_TABLESPACE_EXISTS

#define HA_ERR_TABLESPACE_EXISTS   184

The tablespace existed in storage engine.

◆ HA_ERR_TABLESPACE_IS_NOT_EMPTY

#define HA_ERR_TABLESPACE_IS_NOT_EMPTY   198

Tablespace is not empty.

◆ HA_ERR_TABLESPACE_MISSING

#define HA_ERR_TABLESPACE_MISSING   197

Missing Tablespace.

◆ HA_ERR_TEMP_FILE_WRITE_FAILURE

#define HA_ERR_TEMP_FILE_WRITE_FAILURE   189

Temporary file write failure.

◆ HA_ERR_TOO_BIG_ROW

#define HA_ERR_TOO_BIG_ROW   139

Too big row.

◆ HA_ERR_TOO_LONG_PATH

#define HA_ERR_TOO_LONG_PATH   207

Path is too long for the OS.

◆ HA_ERR_TOO_MANY_CONCURRENT_TRXS

#define HA_ERR_TOO_MANY_CONCURRENT_TRXS   177

Too many active concurrent transactions.

◆ HA_ERR_TOO_MANY_FIELDS

#define HA_ERR_TOO_MANY_FIELDS   185

Table has too many columns.

◆ HA_ERR_UNDO_REC_TOO_BIG

#define HA_ERR_UNDO_REC_TOO_BIG   181

Undo log record too big.

◆ HA_ERR_UNKNOWN_CHARSET

#define HA_ERR_UNKNOWN_CHARSET   142

Can't open charset.

◆ HA_ERR_UNSUPPORTED

#define HA_ERR_UNSUPPORTED   138

unsupported extension used

◆ HA_ERR_WRONG_COMMAND

#define HA_ERR_WRONG_COMMAND   131

Command not supported.

◆ HA_ERR_WRONG_CRC

#define HA_ERR_WRONG_CRC   176

Wrong CRC on page.

◆ HA_ERR_WRONG_FILE_NAME

#define HA_ERR_WRONG_FILE_NAME   199

Invalid Filename.

◆ HA_ERR_WRONG_IN_RECORD

#define HA_ERR_WRONG_IN_RECORD   127

Record-file is crashed.

◆ HA_ERR_WRONG_INDEX

#define HA_ERR_WRONG_INDEX   124

Wrong index given to function.

◆ HA_ERR_WRONG_MRG_TABLE_DEF

#define HA_ERR_WRONG_MRG_TABLE_DEF   143

conflicting tables in MERGE

◆ HA_ERR_WRONG_TABLE_NAME

#define HA_ERR_WRONG_TABLE_NAME   206

Wrong or Invalid table name.

◆ HA_EXTRA_PREPARE_FOR_DELETE

#define HA_EXTRA_PREPARE_FOR_DELETE   HA_EXTRA_PREPARE_FOR_DROP

◆ HA_FTS_INVALID_DOCID

#define HA_FTS_INVALID_DOCID   182

Invalid InnoDB Doc ID.

◆ HA_FULLTEXT

#define HA_FULLTEXT   (1 << 7)

Full-text key.

◆ HA_GENERATED_KEY

#define HA_GENERATED_KEY   (1 << 13)

Key was automatically created to support Foreign Key constraint.

◆ HA_KEY_HAS_PART_KEY_SEG

#define HA_KEY_HAS_PART_KEY_SEG   (1 << 16)

Key contains partial segments.

Note
This flag is internal to SQL-layer by design. It is not supposed to be used to storage engines. It is intended to pass information into internal static sort_keys(KEY *, KEY *) function.

This flag can be calculated – it's based on key lengths comparison.

◆ HA_KEY_RENAMED

#define HA_KEY_RENAMED   (1 << 17)

Key was renamed (or is result of renaming a key).

This is another flag internal to SQL-layer. Used by in-place ALTER TABLE implementation.

Note
This flag can be set for keys which have other changes than simple renaming as well. So from the point of view of storage engine such key might have to be dropped and re-created with new definition.

◆ HA_KEYFLAG_MASK

#define HA_KEYFLAG_MASK
Value:
#define HA_GENERATED_KEY
Key was automatically created to support Foreign Key constraint.
Definition: my_base.h:519
#define HA_AUTO_KEY
Auto-increment key.
Definition: my_base.h:493
#define HA_BINARY_PACK_KEY
Packing of all keys to previous key (optimization supported by MyISAM).
Definition: my_base.h:495
#define HA_SPATIAL
Spatial key.
Definition: my_base.h:509
#define HA_NULL_ARE_EQUAL
NULLs in key are compared as equal.
Definition: my_base.h:515
#define HA_PACK_KEY
Pack string key to previous key (optimization supported by MyISAM).
Definition: my_base.h:477
#define HA_FULLTEXT
Full-text key.
Definition: my_base.h:499
#define HA_NOSAME
Do not allow duplicate records.
Definition: my_base.h:475

◆ HA_MAX_KEYTYPE

#define HA_MAX_KEYTYPE   31 /* Must be log2-1 */

◆ HA_MISSING_CREATE_OPTION

#define HA_MISSING_CREATE_OPTION   193

Option Missing during Create.

◆ HA_MULTI_VALUED_KEY

#define HA_MULTI_VALUED_KEY   (1 << 19)

Multi-valued key.

◆ HA_NAMELEN

#define HA_NAMELEN   64 /* Max length of saved filename */

◆ HA_NO_SORT

#define HA_NO_SORT   256 /* do not bother sorting on this keyseg */

◆ HA_NOSAME

#define HA_NOSAME   1

Do not allow duplicate records.

◆ HA_NULL_ARE_EQUAL

#define HA_NULL_ARE_EQUAL   (1 << 11)

NULLs in key are compared as equal.

Note
Used only for internal temporary tables created by optimizer.

◆ HA_NULL_PART

#define HA_NULL_PART   16

◆ HA_NULL_PART_KEY

#define HA_NULL_PART_KEY   (1 << 6)

Some key part is nullable.

◆ HA_OFFSET_ERROR

#define HA_OFFSET_ERROR   (~(my_off_t)0)

◆ HA_OPEN_ABORT_IF_CRASHED

#define HA_OPEN_ABORT_IF_CRASHED   16

◆ HA_OPEN_ABORT_IF_LOCKED

#define HA_OPEN_ABORT_IF_LOCKED   0 /* default */

◆ HA_OPEN_COPY

#define HA_OPEN_COPY   256 /* Open copy (for repair) */

◆ HA_OPEN_DELAY_KEY_WRITE

#define HA_OPEN_DELAY_KEY_WRITE   8 /* Don't update index */

◆ HA_OPEN_FOR_REPAIR

#define HA_OPEN_FOR_REPAIR   32 /* open even if crashed */

◆ HA_OPEN_FROM_SQL_LAYER

#define HA_OPEN_FROM_SQL_LAYER   64

◆ HA_OPEN_IGNORE_IF_LOCKED

#define HA_OPEN_IGNORE_IF_LOCKED   2

◆ HA_OPEN_INTERNAL_TABLE

#define HA_OPEN_INTERNAL_TABLE   512

Internal temp table, used for temporary results; one or more instance of it may be be created.

◆ HA_OPEN_TMP_TABLE

#define HA_OPEN_TMP_TABLE   4 /* Table is a temp table */

◆ HA_OPEN_WAIT_IF_LOCKED

#define HA_OPEN_WAIT_IF_LOCKED   1

◆ HA_OPTION_CHECKSUM

#define HA_OPTION_CHECKSUM   32

CHECKSUM=1 option was specified.

This option enables live checksumming for MyISAM tables. Not used by InnoDB.

See also
HA_OPTION_NO_CHECKSUM.

◆ HA_OPTION_COMPRESS_RECORD

#define HA_OPTION_COMPRESS_RECORD   4

Flag indicating that table is compressed.

Used by MyISAM storage engine to tell SQL-layer that tables is compressed. Not set or stored by SQL-layer,

MyISAM doesn't respect ROW_FORMAT=COMPRESSED clause and doesn't allow direct creation of compressed tables. Existing tables can be compressed by external tool. This tool marks such tables with HA_OPTION_COMPRESS_RECORD flag in MYISAM_SHARE::options, MI_ISAMINFO::options. Then storage engine sets this flag in TABLE_SHARE::db_options_in_use to let SQL-layer know about the fact. It is never set in HA_CREATE_INFO::table_options or TABLE_SHARE::db_create_options.

◆ HA_OPTION_CREATE_FROM_ENGINE

#define HA_OPTION_CREATE_FROM_ENGINE   256

Flag specific to table creation and HA_CREATE_INFO::table_options.

Indicates that storage engine instead of creating new table, needs to discover existing one (which metadata was discovered from SE earlier). Not used in TABLE_SHARE::db_create_options/db_options_in_use.

◆ HA_OPTION_DELAY_KEY_WRITE

#define HA_OPTION_DELAY_KEY_WRITE   64

DELAY_KEY_WRITE=1 option was specified.

This option enables MyISAM optimization which postpones key updates until table is closed/expelled from the table cache.

See also
HA_OPTION_NO_DELAY_KEY_WRITE.

◆ HA_OPTION_NO_CHECKSUM

#define HA_OPTION_NO_CHECKSUM   (1L << 17)

CHECKSUM=0 option was specified.

Only used by SQL-layer, in HA_CREATE_INFO::table_options. Not persisted in data-dictionary.

◆ HA_OPTION_NO_DELAY_KEY_WRITE

#define HA_OPTION_NO_DELAY_KEY_WRITE   (1L << 18)

DELAY_KEY_WRITE=0 option was specified.

Only used by SQL-layer, in HA_CREATE_INFO::table_options. Not persisted in data-dictionary.

◆ HA_OPTION_NO_PACK_KEYS

#define HA_OPTION_NO_PACK_KEYS   128

PACK_KEYS=0 option was specified.

See also
HA_OPTION_PACK_KEYS for further description.
Note
Unlike HA_OPTION_PACK_KEYS this flag is SQL-layer only.

◆ HA_OPTION_NO_STATS_PERSISTENT

#define HA_OPTION_NO_STATS_PERSISTENT   8192

STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE.

Statistics for the table will be wiped away on server shutdown and new ones recalculated after the server is started again. If none of HA_OPTION_STATS_PERSISTENT or HA_OPTION_NO_STATS_PERSISTENT is set, this means that the setting is not explicitly set at table level and the corresponding table will use whatever is the global server default.

◆ HA_OPTION_PACK_KEYS

#define HA_OPTION_PACK_KEYS   2

PACK_KEYS=1 option was specified.

PACK_KEYS=# option specifies whether key packing - optimization supported by MyISAM, should be used. PACK_KEYS=1 means all keys should be packed, PACK_KEYS=0 (denoted by

See also
HA_OPTION_NO_PACK_KEYS flag) means that key packing should not be used at all. Not using this option or using PACK_KEYS=DEFAULT clause (denoted by absence of both HA_OPTION_PACK_KEYS and HA_OPTION_NO_PACK_KEYS flags) means that key packing will be used for long string columns.

◆ HA_OPTION_PACK_RECORD

#define HA_OPTION_PACK_RECORD   1

Indicates that storage engine needs to use packed row format.

Set for tables with ROW_FORMAT=DYNAMIC clause, for tables with BLOB fields, and for tables with VARCHAR columns without ROW_FORMAT=FIXED.

This flag is respected by MyISAM only (it might also decide to use this optimization for its own reasons). InnoDB relies on HA_CREATE_INFO::row_type directly instead.

◆ HA_OPTION_READ_ONLY_DATA

#define HA_OPTION_READ_ONLY_DATA   32768

MyISAM internal flag which marks table as read-only.

Set by myisampack external tool.

Not used by SQL-layer/in HA_CREATE_INFO::table_options and TABLE_SHARE::db_create_options.

◆ HA_OPTION_RELIES_ON_SQL_LAYER

#define HA_OPTION_RELIES_ON_SQL_LAYER   512

Storage engine (MyISAM) internal flag for marking tables which rely on SQL-layer because they have keys using fulltext parser plugin.

Used in MYISAM_SHARE::options, MI_ISAMINFO::options, not used by SQL-layer, in HA_CREATE_INFO::table_options or TABLE_SHARE::db_create_options.

◆ HA_OPTION_STATS_PERSISTENT

#define HA_OPTION_STATS_PERSISTENT   4096

STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE or ALTER TABLE).

Table and index statistics that are collected by the storage engine and used by the optimizer for query optimization will be stored on disk and will not change after a server restart.

◆ HA_OPTION_TEMP_COMPRESS_RECORD

#define HA_OPTION_TEMP_COMPRESS_RECORD   16384

MyISAM internal flag used by myisamchk external tool.

Not used by SQL-layer/in HA_CREATE_INFO::table_options and TABLE_SHARE::db_create_options.

◆ HA_OPTION_TMP_TABLE

#define HA_OPTION_TMP_TABLE   16

Storage engine (MyISAM) internal flag for marking temporary tables.

Used in MYISAM_SHARE::options, MI_ISAMINFO::options, not used by SQL-layer, in HA_CREATE_INFO::table_options or TABLE_SHARE::db_create_options.

◆ HA_OPTION_UNUSED1

#define HA_OPTION_UNUSED1   8

Unused.

Formerly HA_OPTION_LONG_BLOB_PTR - new ISAM format/portable BLOB pointers.

◆ HA_OPTION_UNUSED2

#define HA_OPTION_UNUSED2   1024

Unused.

Formerly HA_OPTION_NULL_FIELDS - reserved for Maria SE.

◆ HA_OPTION_UNUSED3

#define HA_OPTION_UNUSED3   2048

Unused.

Formerly HA_OPTION_PAGE_CHECKSUM - reserved for Maria SE.

◆ HA_PACK_KEY

#define HA_PACK_KEY   (1 << 1)

Pack string key to previous key (optimization supported by MyISAM).

◆ HA_PACK_RECORD

#define HA_PACK_RECORD   2 /* Request packed record format */

◆ HA_PART_KEY_SEG

#define HA_PART_KEY_SEG   4 /* Used by MySQL for part-key-cols */

◆ HA_POS_ERROR

#define HA_POS_ERROR   (~(ha_rows)0)

◆ HA_REVERSE_SORT

#define HA_REVERSE_SORT   128 /* Sort key in reverse order */

◆ HA_SORT_ALLOWS_SAME

#define HA_SORT_ALLOWS_SAME   (1 << 9)

Internal bit used when sorting records.

Internal to MyISAM.

◆ HA_SPACE_PACK

#define HA_SPACE_PACK   1 /* Pack space in key-seg */

◆ HA_SPACE_PACK_USED

#define HA_SPACE_PACK_USED   (1 << 2)

Some key part packs space.

Internal to MyISAM.

◆ HA_SPATIAL

#define HA_SPATIAL   (1 << 10)

Spatial key.

◆ HA_STATE_AKTIV

#define HA_STATE_AKTIV   2 /* Has a current record */

◆ HA_STATE_BUFF_SAVED

#define HA_STATE_BUFF_SAVED   512 /* If current keybuff is info->buff */

◆ HA_STATE_CHANGED

#define HA_STATE_CHANGED   1 /* Database has changed */

◆ HA_STATE_DELETED

#define HA_STATE_DELETED   8

◆ HA_STATE_EXTEND_BLOCK

#define HA_STATE_EXTEND_BLOCK   2048

◆ HA_STATE_KEY_CHANGED

#define HA_STATE_KEY_CHANGED   128

◆ HA_STATE_NEXT_FOUND

#define HA_STATE_NEXT_FOUND   16 /* Next found record (record before) */

◆ HA_STATE_NO_KEY

#define HA_STATE_NO_KEY   64 /* Last read didn't find record */

◆ HA_STATE_PREV_FOUND

#define HA_STATE_PREV_FOUND   32 /* Prev found record (record after) */

◆ HA_STATE_ROW_CHANGED

#define HA_STATE_ROW_CHANGED   1024 /* To invalidate ROW cache */

◆ HA_STATE_WRITE_AT_END

#define HA_STATE_WRITE_AT_END   256 /* set in _ps_find_writepos */

◆ HA_STATE_WRITTEN

#define HA_STATE_WRITTEN   4 /* Record is written */

◆ HA_STATUS_AUTO

#define HA_STATUS_AUTO   64

◆ HA_STATUS_CONST

#define HA_STATUS_CONST   8

◆ HA_STATUS_ERRKEY

#define HA_STATUS_ERRKEY   32

◆ HA_STATUS_NO_LOCK

#define HA_STATUS_NO_LOCK   2

◆ HA_STATUS_POS

#define HA_STATUS_POS   1

◆ HA_STATUS_TIME

#define HA_STATUS_TIME   4

◆ HA_STATUS_VARIABLE

#define HA_STATUS_VARIABLE   16

◆ HA_STATUS_VARIABLE_EXTRA

#define HA_STATUS_VARIABLE_EXTRA   128

◆ HA_SWAP_KEY

#define HA_SWAP_KEY   64

◆ HA_UNIQUE_CHECK

#define HA_UNIQUE_CHECK   (1 << 8)

Flag in MI_KEYDEF::flag which marks MyISAM's "uniques".

Note
Internal to MyISAM. Current server doesn't use this feature.

◆ HA_USES_BLOCK_SIZE

#define HA_USES_BLOCK_SIZE   (1 << 15)

Key uses KEY_BLOCK_SIZE option.

◆ HA_USES_COMMENT

#define HA_USES_COMMENT   (1 << 12)

Key has comment.

◆ HA_USES_PARSER

#define HA_USES_PARSER   (1 << 14)

Fulltext index uses [pre]parser.

◆ HA_VAR_LENGTH_KEY

#define HA_VAR_LENGTH_KEY   (1 << 3)

Some key part has variable length.

Internal to MyISAM and Heap engines.

◆ HA_VAR_LENGTH_PART

#define HA_VAR_LENGTH_PART   8

◆ HA_VARCHAR_PACKLENGTH

#define HA_VARCHAR_PACKLENGTH (   field_length)    ((field_length) < 256 ? 1 : 2)

◆ HA_VIRTUAL_GEN_KEY

#define HA_VIRTUAL_GEN_KEY   (1 << 18)

Set if a key is on any virtual generated columns.

◆ HA_WHOLE_KEY

#define HA_WHOLE_KEY   (~(key_part_map)0)

◆ HA_WRONG_CREATE_OPTION

#define HA_WRONG_CREATE_OPTION   140

Wrong create option.

◆ KEY_READ_USED

#define KEY_READ_USED   8

◆ MAX_FILE_SIZE

#define MAX_FILE_SIZE   LLONG_MAX

◆ MBR_CONTAIN

#define MBR_CONTAIN   512

◆ MBR_DATA

#define MBR_DATA   16384

◆ MBR_DISJOINT

#define MBR_DISJOINT   4096

◆ MBR_EQUAL

#define MBR_EQUAL   8192

◆ MBR_INTERSECT

#define MBR_INTERSECT   1024

◆ MBR_WITHIN

#define MBR_WITHIN   2048

◆ NO_SUCH_KEY

#define NO_SUCH_KEY   (~(uint)0) /* used as a key no. */

◆ OPT_NO_ROWS

#define OPT_NO_ROWS   32

◆ QUICK_USED

#define QUICK_USED   1

◆ READ_CACHE_USED

#define READ_CACHE_USED   2

◆ READ_CHECK_USED

#define READ_CHECK_USED   4

◆ rows2double

#define rows2double (   A)    ulonglong2double(A)

◆ SEARCH_BIGGER

#define SEARCH_BIGGER   8

◆ SEARCH_FIND

#define SEARCH_FIND   1

◆ SEARCH_LAST

#define SEARCH_LAST   256

◆ SEARCH_NO_FIND

#define SEARCH_NO_FIND   2

◆ SEARCH_NULL_ARE_EQUAL

#define SEARCH_NULL_ARE_EQUAL   32768 /* NULL in keys are equal */

◆ SEARCH_NULL_ARE_NOT_EQUAL

#define SEARCH_NULL_ARE_NOT_EQUAL   65536 /* NULL in keys are not equal */

◆ SEARCH_PREFIX

#define SEARCH_PREFIX   128

◆ SEARCH_SAME

#define SEARCH_SAME   4

◆ SEARCH_SAVE_BUFF

#define SEARCH_SAVE_BUFF   32

◆ SEARCH_SMALLER

#define SEARCH_SMALLER   16

◆ SEARCH_UPDATE

#define SEARCH_UPDATE   64

◆ WRITE_CACHE_USED

#define WRITE_CACHE_USED   16

Typedef Documentation

◆ ha_rows

typedef my_off_t ha_rows

◆ key_part_map

typedef ulong key_part_map

Enumeration Type Documentation

◆ data_file_type

Enumerator
STATIC_RECORD 
DYNAMIC_RECORD 
COMPRESSED_RECORD 
BLOCK_RECORD 

◆ en_fieldtype

Enumerator
FIELD_LAST 
FIELD_NORMAL 
FIELD_SKIP_ENDSPACE 
FIELD_SKIP_PRESPACE 
FIELD_SKIP_ZERO 
FIELD_BLOB 
FIELD_CONSTANT 
FIELD_INTERVALL 
FIELD_ZERO 
FIELD_VARCHAR 
FIELD_CHECK 
FIELD_enum_val_count 

◆ ha_base_keytype

Enumerator
HA_KEYTYPE_END 
HA_KEYTYPE_TEXT 
HA_KEYTYPE_BINARY 
HA_KEYTYPE_SHORT_INT 
HA_KEYTYPE_LONG_INT 
HA_KEYTYPE_FLOAT 
HA_KEYTYPE_DOUBLE 
HA_KEYTYPE_NUM 
HA_KEYTYPE_USHORT_INT 
HA_KEYTYPE_ULONG_INT 
HA_KEYTYPE_LONGLONG 
HA_KEYTYPE_ULONGLONG 
HA_KEYTYPE_INT24 
HA_KEYTYPE_UINT24 
HA_KEYTYPE_INT8 
HA_KEYTYPE_VARTEXT1 
HA_KEYTYPE_VARBINARY1 
HA_KEYTYPE_VARTEXT2 
HA_KEYTYPE_VARBINARY2 
HA_KEYTYPE_BIT 

◆ ha_extra_function

Enumerator
HA_EXTRA_NORMAL 
HA_EXTRA_QUICK 
HA_EXTRA_NOT_USED 
HA_EXTRA_NO_READCHECK 
HA_EXTRA_READCHECK 
HA_EXTRA_KEYREAD 
HA_EXTRA_NO_KEYREAD 
HA_EXTRA_NO_USER_CHANGE 
HA_EXTRA_WAIT_LOCK 
HA_EXTRA_NO_WAIT_LOCK 
HA_EXTRA_NO_KEYS 
HA_EXTRA_KEYREAD_CHANGE_POS 
HA_EXTRA_REMEMBER_POS 
HA_EXTRA_RESTORE_POS 
HA_EXTRA_FORCE_REOPEN 
HA_EXTRA_FLUSH 
HA_EXTRA_NO_ROWS 
HA_EXTRA_RESET_STATE 
HA_EXTRA_IGNORE_DUP_KEY 
HA_EXTRA_NO_IGNORE_DUP_KEY 
HA_EXTRA_PREPARE_FOR_DROP 
HA_EXTRA_PREPARE_FOR_UPDATE 
HA_EXTRA_PRELOAD_BUFFER_SIZE 
HA_EXTRA_CHANGE_KEY_TO_UNIQUE 
HA_EXTRA_CHANGE_KEY_TO_DUP 
HA_EXTRA_KEYREAD_PRESERVE_FIELDS 
HA_EXTRA_IGNORE_NO_KEY 
HA_EXTRA_NO_IGNORE_NO_KEY 
HA_EXTRA_MARK_AS_LOG_TABLE 
HA_EXTRA_WRITE_CAN_REPLACE 
HA_EXTRA_WRITE_CANNOT_REPLACE 
HA_EXTRA_DELETE_CANNOT_BATCH 
HA_EXTRA_UPDATE_CANNOT_BATCH 
HA_EXTRA_INSERT_WITH_UPDATE 
HA_EXTRA_PREPARE_FOR_RENAME 
HA_EXTRA_ADD_CHILDREN_LIST 
HA_EXTRA_ATTACH_CHILDREN 
HA_EXTRA_IS_ATTACHED_CHILDREN 
HA_EXTRA_DETACH_CHILDREN 
HA_EXTRA_EXPORT 
HA_EXTRA_SECONDARY_SORT_ROWID 

Do secondary sort by handler::ref (rowid) after key sort.

HA_EXTRA_NO_READ_LOCKING 

Skip acquiring locks when reading from ACL tables or views on DD tables in order to make such reads non blocking.

HA_EXTRA_BEGIN_ALTER_COPY 
HA_EXTRA_END_ALTER_COPY 
HA_EXTRA_NO_AUTOINC_LOCKING 
HA_EXTRA_ENABLE_UNIQUE_RECORD_FILTER 
HA_EXTRA_DISABLE_UNIQUE_RECORD_FILTER 

◆ ha_key_alg

enum ha_key_alg
Enumerator
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 from this enum (.

See also
Federated, PerfSchema SE,
dd::Index::IA_SE_SPECIFIC).
Note
Assigned as default value for key algorithm by parser, replaced by SEs default algorithm for keys in mysql_prepare_create_table().
HA_KEY_ALG_BTREE 
HA_KEY_ALG_RTREE 
HA_KEY_ALG_HASH 
HA_KEY_ALG_FULLTEXT 

◆ ha_panic_function

Enumerator
HA_PANIC_CLOSE 
HA_PANIC_WRITE 
HA_PANIC_READ 

◆ ha_rkey_function

Enumerator
HA_READ_KEY_EXACT 
HA_READ_KEY_OR_NEXT 
HA_READ_KEY_OR_PREV 
HA_READ_AFTER_KEY 
HA_READ_BEFORE_KEY 
HA_READ_PREFIX 
HA_READ_PREFIX_LAST 
HA_READ_PREFIX_LAST_OR_PREV 
HA_READ_MBR_CONTAIN 
HA_READ_MBR_INTERSECT 
HA_READ_MBR_WITHIN 
HA_READ_MBR_DISJOINT 
HA_READ_MBR_EQUAL 
HA_READ_NEAREST_NEIGHBOR 
HA_READ_INVALID 

◆ ha_storage_media

Enumerator
HA_SM_DEFAULT 
HA_SM_DISK 
HA_SM_MEMORY 

◆ key_range_flags

Enumerator
NO_MIN_RANGE 

from -inf

NO_MAX_RANGE 

to +inf

NEAR_MIN 
NEAR_MAX 
UNIQUE_RANGE 
EQ_RANGE 
NULL_RANGE 
GEOM_FLAG 

This flag means that the index is an rtree index, and the interval is specified using HA_READ_MBR_XXX defined in enum ha_rkey_function.

SKIP_RANGE 
SKIP_RECORDS_IN_RANGE 
DESC_FLAG 

Variable Documentation

◆ HA_INDEX_USES_ENGINE_ATTRIBUTE

constexpr const ulong HA_INDEX_USES_ENGINE_ATTRIBUTE {1UL << 20}
constexpr

◆ HA_INDEX_USES_SECONDARY_ENGINE_ATTRIBUTE

constexpr const ulong HA_INDEX_USES_SECONDARY_ENGINE_ATTRIBUTE {1UL << 21}
constexpr