summaryrefslogtreecommitdiff
path: root/include/my_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/my_base.h')
-rw-r--r--include/my_base.h67
1 files changed, 47 insertions, 20 deletions
diff --git a/include/my_base.h b/include/my_base.h
index c10a325763e..36c97d61cb9 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -19,8 +19,6 @@
#ifndef _my_base_h
#define _my_base_h
-#ifndef stdin /* Included first in handler */
-#define CHSIZE_USED
#include <my_global.h>
#include <my_dir.h> /* This includes types */
#include <my_sys.h>
@@ -31,7 +29,6 @@
#define EOVERFLOW 84
#endif
-#endif /* stdin */
#include <my_list.h>
/* The following is bits in the flag parameter to ha_open() */
@@ -48,6 +45,7 @@
#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
/* The following is parameter to ha_rkey() how to use key */
@@ -109,7 +107,7 @@ enum ha_storage_media {
enum ha_extra_function {
HA_EXTRA_NORMAL=0, /* Optimize for space (def) */
HA_EXTRA_QUICK=1, /* Optimize for speed */
- HA_EXTRA_NOT_USED=2,
+ HA_EXTRA_NOT_USED=2, /* Should be ignored by handler */
HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */
HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */
HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */
@@ -194,7 +192,10 @@ enum ha_extra_function {
HA_EXTRA_ADD_CHILDREN_LIST,
HA_EXTRA_ATTACH_CHILDREN,
HA_EXTRA_IS_ATTACHED_CHILDREN,
- HA_EXTRA_DETACH_CHILDREN
+ HA_EXTRA_DETACH_CHILDREN,
+ HA_EXTRA_DETACH_CHILD,
+ /* Inform handler we will force a close as part of flush */
+ HA_EXTRA_PREPARE_FOR_FORCED_CLOSE
};
/* Compatible option, to be deleted in 6.0 */
@@ -237,7 +238,10 @@ enum ha_base_keytype {
#define HA_MAX_KEYTYPE 31 /* Must be log2-1 */
- /* These flags kan be OR:ed to key-flag */
+/*
+ These flags kan be OR:ed to key-flag
+ Note that these can only be up to 16 bits!
+*/
#define HA_NOSAME 1 /* Set if not dupplicated records */
#define HA_PACK_KEY 2 /* Pack string key to previous key */
@@ -248,11 +252,13 @@ 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_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY | \
+ HA_RTREE_INDEX)
/*
Key contains partial segments.
@@ -276,6 +282,9 @@ enum ha_base_keytype {
#define HA_USES_BLOCK_SIZE ((uint) 32768)
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
+/* This flag can be used only in KEY::ext_key_flags */
+#define HA_EXT_NOSAME 131072
+
/* These flags can be added to key-seg-flag */
#define HA_SPACE_PACK 1 /* Pack space in key-seg */
@@ -292,6 +301,7 @@ enum ha_base_keytype {
*/
#define HA_END_SPACE_ARE_EQUAL 512
#define HA_BIT_PART 1024
+#define HA_CAN_MEMCMP 2048 /* internal, never stored in frm */
/* optionbits for database */
#define HA_OPTION_PACK_RECORD 1
@@ -306,8 +316,12 @@ enum ha_base_keytype {
#define HA_OPTION_RELIES_ON_SQL_LAYER 512
#define HA_OPTION_NULL_FIELDS 1024
#define HA_OPTION_PAGE_CHECKSUM 2048
-#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
-#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
+/* .frm has extra create options in linked-list format */
+#define HA_OPTION_TEXT_CREATE_OPTIONS (1L << 14)
+#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)
+#define HA_OPTION_NO_DELAY_KEY_WRITE (1L << 18)
/* Bits in flag to create() */
@@ -435,22 +449,25 @@ enum ha_base_keytype {
/* 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 /* 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_LOGGING_IMPOSSIBLE 170
+/* The event was corrupt, leading to illegal data being read */
+#define HA_ERR_CORRUPT_EVENT 171
#define HA_ERR_NEW_FILE 172 /* New file format */
-#define HA_ERR_ROWS_EVENT_APPLY 173 /* The event could not be processed
- no other hanlder error happened */
+/* The event could not be processed no other handler error happened */
+#define HA_ERR_ROWS_EVENT_APPLY 173
#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_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_LAST 181 /* Copy of last error nr */
+#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 */
/* Number of different errors */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
@@ -483,6 +500,14 @@ typedef ulong key_part_map;
#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 */
+/* Use this when inserting a key in position order */
+#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
+/* Used when user key (key 2) contains transaction id's */
+#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
/* bits in opt_flag */
#define QUICK_USED 1
@@ -516,7 +541,7 @@ enum en_fieldtype {
};
enum data_file_type {
- STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD
+ STATIC_RECORD, DYNAMIC_RECORD, COMPRESSED_RECORD, BLOCK_RECORD, NO_RECORD
};
/* For key ranges */
@@ -539,11 +564,13 @@ typedef struct st_key_range
enum ha_rkey_function flag;
} key_range;
+typedef void *range_id_t;
+
typedef struct st_key_multi_range
{
key_range start_key;
key_range end_key;
- char *ptr; /* Free to use by caller (ptr to row etc) */
+ range_id_t ptr; /* Free to use by caller (ptr to row etc) */
uint range_flag; /* key range flags see above */
} KEY_MULTI_RANGE;