diff options
Diffstat (limited to 'include/my_base.h')
-rw-r--r-- | include/my_base.h | 102 |
1 files changed, 75 insertions, 27 deletions
diff --git a/include/my_base.h b/include/my_base.h index 36c97d61cb9..5c3dd8db9d9 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2012, Oracle and/or its affiliates. + Copyright (c) 1995, 2012 Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +46,13 @@ #define HA_OPEN_COPY 256 /* Open copy (for repair) */ /* Internal temp table, used for temporary results */ #define HA_OPEN_INTERNAL_TABLE 512 -#define HA_OPEN_MERGE_TABLE 1024 +#define HA_OPEN_NO_PSI_CALL 1024 /* Don't call/connect PSI */ +#define HA_OPEN_MERGE_TABLE 2048 +/* + Allow opening even if table is incompatible as this is for ALTER TABLE which + will fix the table structure. +*/ +#define HA_OPEN_FOR_ALTER 4096 /* The following is parameter to ha_rkey() how to use key */ @@ -252,13 +259,11 @@ enum ha_base_keytype { #define HA_SPATIAL 1024 /* For spatial search */ #define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ #define HA_GENERATED_KEY 8192 /* Automaticly generated key */ -#define HA_RTREE_INDEX 16384 /* For RTREE search */ /* The combination of the above can be used for key type comparison. */ #define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \ HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ - HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY | \ - HA_RTREE_INDEX) + HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) /* Key contains partial segments. @@ -312,12 +317,29 @@ enum ha_base_keytype { #define HA_OPTION_CHECKSUM 32 #define HA_OPTION_DELAY_KEY_WRITE 64 #define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */ -#define HA_OPTION_CREATE_FROM_ENGINE 256 +/* unused 256 */ #define HA_OPTION_RELIES_ON_SQL_LAYER 512 #define HA_OPTION_NULL_FIELDS 1024 #define HA_OPTION_PAGE_CHECKSUM 2048 +/* + 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. +*/ +#define HA_OPTION_STATS_PERSISTENT 4096 +/* + 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. +*/ +#define HA_OPTION_NO_STATS_PERSISTENT 8192 + /* .frm has extra create options in linked-list format */ -#define HA_OPTION_TEXT_CREATE_OPTIONS (1L << 14) +#define HA_OPTION_TEXT_CREATE_OPTIONS_legacy (1L << 14) /* 5.2 to 5.5, unused since 10.0 */ #define HA_OPTION_TEMP_COMPRESS_RECORD (1L << 15) /* set by isamchk */ #define HA_OPTION_READ_ONLY_DATA (1L << 16) /* Set by isamchk */ #define HA_OPTION_NO_CHECKSUM (1L << 17) @@ -333,6 +355,12 @@ enum ha_base_keytype { #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 + +/* Flags used by start_bulk_insert */ + +#define HA_CREATE_UNIQUE_INDEX_BY_SORT 1 + /* The following flags (OR-ed) are passed to handler::info() method. @@ -398,7 +426,7 @@ enum ha_base_keytype { #define HA_ERR_WRONG_INDEX 124 /* Wrong index given to function */ #define HA_ERR_CRASHED 126 /* Indexfile is crashed */ #define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */ -#define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */ +#define HA_ERR_OUT_OF_MEM 128 /* Out of memory */ #define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */ #define HA_ERR_WRONG_COMMAND 131 /* Command not supported */ #define HA_ERR_OLD_FILE 132 /* old databasfile */ @@ -448,26 +476,33 @@ enum ha_base_keytype { #define HA_ERR_GENERIC 168 /* Generic error */ /* row not actually updated: new values same as the old values */ #define HA_ERR_RECORD_IS_THE_SAME 169 -/* It is not possible to log this statement */ -#define HA_ERR_LOGGING_IMPOSSIBLE 170 -/* The event was corrupt, leading to illegal data being read */ -#define HA_ERR_CORRUPT_EVENT 171 +#define HA_ERR_LOGGING_IMPOSSIBLE 170 /* It is not possible to log this + statement */ +#define HA_ERR_CORRUPT_EVENT 171 /* The event was corrupt, leading to + illegal data being read */ #define HA_ERR_NEW_FILE 172 /* New file format */ -/* The event could not be processed no other handler error happened */ -#define HA_ERR_ROWS_EVENT_APPLY 173 +#define HA_ERR_ROWS_EVENT_APPLY 173 /* The event could not be processed + no other hanlder error happened */ #define HA_ERR_INITIALIZATION 174 /* Error during initialization */ #define HA_ERR_FILE_TOO_SHORT 175 /* File too short */ #define HA_ERR_WRONG_CRC 176 /* Wrong CRC on page */ #define HA_ERR_TOO_MANY_CONCURRENT_TRXS 177 /*Too many active concurrent transactions */ -#define HA_ERR_INDEX_COL_TOO_LONG 178 /* Index column length exceeds limit */ -#define HA_ERR_INDEX_CORRUPT 179 /* Index corrupted */ -#define HA_ERR_UNDO_REC_TOO_BIG 180 /* Undo log record too big */ -#define HA_ERR_TABLE_IN_FK_CHECK 181 /* Table being used in foreign key check */ -#define HA_ERR_ROW_NOT_VISIBLE 182 -#define HA_ERR_ABORTED_BY_USER 183 -#define HA_ERR_DISK_FULL 184 -#define HA_ERR_INCOMPATIBLE_DEFINITION 185 -#define HA_ERR_LAST 185 /* Copy of last error nr */ +/* There's no explicitly listed partition in table for the given value */ +#define HA_ERR_NOT_IN_LOCK_PARTITIONS 178 +#define HA_ERR_INDEX_COL_TOO_LONG 179 /* Index column length exceeds limit */ +#define HA_ERR_INDEX_CORRUPT 180 /* Index corrupted */ +#define HA_ERR_UNDO_REC_TOO_BIG 181 /* Undo log record too big */ +#define HA_FTS_INVALID_DOCID 182 /* Invalid InnoDB Doc ID */ +#define HA_ERR_TABLE_IN_FK_CHECK 183 /* Table being used in foreign key check */ +#define HA_ERR_TABLESPACE_EXISTS 184 /* The tablespace existed in storage engine */ +#define HA_ERR_TOO_MANY_FIELDS 185 /* Table has too many columns */ +#define HA_ERR_ROW_IN_WRONG_PARTITION 186 /* Row in wrong partition */ +#define HA_ERR_ROW_NOT_VISIBLE 187 +#define HA_ERR_ABORTED_BY_USER 188 +#define HA_ERR_DISK_FULL 189 +#define HA_ERR_INCOMPATIBLE_DEFINITION 190 +#define HA_ERR_FTS_TOO_MANY_WORDS_IN_PHRASE 191 /* Too many words in a phrase */ +#define HA_ERR_LAST 191 /* Copy of last error nr */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) @@ -501,13 +536,13 @@ typedef ulong key_part_map; #define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ #define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ /* Use this when inserting a key in position order */ -#define SEARCH_INSERT SEARCH_NULL_ARE_NOT_EQUAL*2 +#define SEARCH_INSERT (SEARCH_NULL_ARE_NOT_EQUAL*2) /* Only part of the key is specified while reading */ -#define SEARCH_PART_KEY SEARCH_INSERT*2 +#define SEARCH_PART_KEY (SEARCH_INSERT*2) /* Used when user key (key 2) contains transaction id's */ -#define SEARCH_USER_KEY_HAS_TRANSID SEARCH_PART_KEY*2 +#define SEARCH_USER_KEY_HAS_TRANSID (SEARCH_PART_KEY*2) /* Used when page key (key 1) contains transaction id's */ -#define SEARCH_PAGE_KEY_HAS_TRANSID SEARCH_USER_KEY_HAS_TRANSID*2 +#define SEARCH_PAGE_KEY_HAS_TRANSID (SEARCH_USER_KEY_HAS_TRANSID*2) /* bits in opt_flag */ #define QUICK_USED 1 @@ -600,4 +635,17 @@ C_MODE_START typedef void (* invalidator_by_filename)(const char * filename); C_MODE_END + +enum durability_properties +{ + /* + Preserves the durability properties defined by the engine */ + HA_REGULAR_DURABILITY= 0, + /* + Ignore the durability properties defined by the engine and + write only in-memory entries. + */ + HA_IGNORE_DURABILITY= 1 +}; + #endif /* _my_base_h */ |