00001 /* Copyright (C) 2000 MySQL AB 00002 00003 This program is free software; you can redistribute it and/or modify 00004 it under the terms of the GNU General Public License as published by 00005 the Free Software Foundation; either version 2 of the License, or 00006 (at your option) any later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ 00016 00017 /* This file includes constants used with all databases */ 00018 /* Author: Michael Widenius */ 00019 00020 #ifndef _my_base_h 00021 #define _my_base_h 00022 00023 #ifndef stdin /* Included first in handler */ 00024 #define CHSIZE_USED 00025 #include <my_global.h> 00026 #include <my_dir.h> /* This includes types */ 00027 #include <my_sys.h> 00028 #include <m_string.h> 00029 #include <errno.h> 00030 00031 #ifndef EOVERFLOW 00032 #define EOVERFLOW 84 00033 #endif 00034 00035 #if !defined(USE_MY_FUNC) && !defined(THREAD) 00036 #include <my_nosys.h> /* For faster code, after test */ 00037 #endif /* USE_MY_FUNC */ 00038 #endif /* stdin */ 00039 #include <my_list.h> 00040 00041 /* The following is bits in the flag parameter to ha_open() */ 00042 00043 #define HA_OPEN_ABORT_IF_LOCKED 0 /* default */ 00044 #define HA_OPEN_WAIT_IF_LOCKED 1 00045 #define HA_OPEN_IGNORE_IF_LOCKED 2 00046 #define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */ 00047 #define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */ 00048 #define HA_OPEN_ABORT_IF_CRASHED 16 00049 #define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */ 00050 #define HA_OPEN_FROM_SQL_LAYER 64 00051 00052 /* The following is parameter to ha_rkey() how to use key */ 00053 00054 /* 00055 We define a complete-field prefix of a key value as a prefix where 00056 the last included field in the prefix contains the full field, not 00057 just some bytes from the start of the field. A partial-field prefix 00058 is allowed to contain only a few first bytes from the last included 00059 field. 00060 00061 Below HA_READ_KEY_EXACT, ..., HA_READ_BEFORE_KEY can take a 00062 complete-field prefix of a key value as the search 00063 key. HA_READ_PREFIX and HA_READ_PREFIX_LAST could also take a 00064 partial-field prefix, but currently (4.0.10) they are only used with 00065 complete-field prefixes. MySQL uses a padding trick to implement 00066 LIKE 'abc%' queries. 00067 00068 NOTE that in InnoDB HA_READ_PREFIX_LAST will NOT work with a 00069 partial-field prefix because InnoDB currently strips spaces from the 00070 end of varchar fields! 00071 */ 00072 00073 enum ha_rkey_function { 00074 HA_READ_KEY_EXACT, /* Find first record else error */ 00075 HA_READ_KEY_OR_NEXT, /* Record or next record */ 00076 HA_READ_KEY_OR_PREV, /* Record or previous */ 00077 HA_READ_AFTER_KEY, /* Find next rec. after key-record */ 00078 HA_READ_BEFORE_KEY, /* Find next rec. before key-record */ 00079 HA_READ_PREFIX, /* Key which as same prefix */ 00080 HA_READ_PREFIX_LAST, /* Last key with the same prefix */ 00081 HA_READ_PREFIX_LAST_OR_PREV, /* Last or prev key with the same prefix */ 00082 HA_READ_MBR_CONTAIN, 00083 HA_READ_MBR_INTERSECT, 00084 HA_READ_MBR_WITHIN, 00085 HA_READ_MBR_DISJOINT, 00086 HA_READ_MBR_EQUAL 00087 }; 00088 00089 /* Key algorithm types */ 00090 00091 enum ha_key_alg { 00092 HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */ 00093 HA_KEY_ALG_BTREE= 1, /* B-tree, default one */ 00094 HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */ 00095 HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */ 00096 HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */ 00097 }; 00098 00099 /* The following is parameter to ha_extra() */ 00100 00101 enum ha_extra_function { 00102 HA_EXTRA_NORMAL=0, /* Optimize for space (def) */ 00103 HA_EXTRA_QUICK=1, /* Optimize for speed */ 00104 HA_EXTRA_NOT_USED=2, 00105 HA_EXTRA_CACHE=3, /* Cache record in HA_rrnd() */ 00106 HA_EXTRA_NO_CACHE=4, /* End caching of records (def) */ 00107 HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */ 00108 HA_EXTRA_READCHECK=6, /* Use readcheck (def) */ 00109 HA_EXTRA_KEYREAD=7, /* Read only key to database */ 00110 HA_EXTRA_NO_KEYREAD=8, /* Normal read of records (def) */ 00111 HA_EXTRA_NO_USER_CHANGE=9, /* No user is allowed to write */ 00112 HA_EXTRA_KEY_CACHE=10, 00113 HA_EXTRA_NO_KEY_CACHE=11, 00114 HA_EXTRA_WAIT_LOCK=12, /* Wait until file is avalably (def) */ 00115 HA_EXTRA_NO_WAIT_LOCK=13, /* If file is locked, return quickly */ 00116 HA_EXTRA_WRITE_CACHE=14, /* Use write cache in ha_write() */ 00117 HA_EXTRA_FLUSH_CACHE=15, /* flush write_record_cache */ 00118 HA_EXTRA_NO_KEYS=16, /* Remove all update of keys */ 00119 HA_EXTRA_KEYREAD_CHANGE_POS=17, /* Keyread, but change pos */ 00120 /* xxxxchk -r must be used */ 00121 HA_EXTRA_REMEMBER_POS=18, /* Remember pos for next/prev */ 00122 HA_EXTRA_RESTORE_POS=19, 00123 HA_EXTRA_REINIT_CACHE=20, /* init cache from current record */ 00124 HA_EXTRA_FORCE_REOPEN=21, /* Datafile have changed on disk */ 00125 HA_EXTRA_FLUSH, /* Flush tables to disk */ 00126 HA_EXTRA_NO_ROWS, /* Don't write rows */ 00127 HA_EXTRA_RESET_STATE, /* Reset positions */ 00128 HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/ 00129 HA_EXTRA_NO_IGNORE_DUP_KEY, 00130 HA_EXTRA_PREPARE_FOR_DELETE, 00131 HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */ 00132 HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */ 00133 /* 00134 On-the-fly switching between unique and non-unique key inserting. 00135 */ 00136 HA_EXTRA_CHANGE_KEY_TO_UNIQUE, 00137 HA_EXTRA_CHANGE_KEY_TO_DUP, 00138 /* 00139 When using HA_EXTRA_KEYREAD, overwrite only key member fields and keep 00140 other fields intact. When this is off (by default) InnoDB will use memcpy 00141 to overwrite entire row. 00142 */ 00143 HA_EXTRA_KEYREAD_PRESERVE_FIELDS, 00144 HA_EXTRA_MMAP, 00145 /* 00146 Ignore if the a tuple is not found, continue processing the 00147 transaction and ignore that 'row'. Needed for idempotency 00148 handling on the slave 00149 00150 Currently only used by NDB storage engine. Partition handler ignores flag. 00151 */ 00152 HA_EXTRA_IGNORE_NO_KEY, 00153 HA_EXTRA_NO_IGNORE_NO_KEY, 00154 /* 00155 Mark the table as a log table. For some handlers (e.g. CSV) this results 00156 in a special locking for the table. 00157 */ 00158 HA_EXTRA_MARK_AS_LOG_TABLE, 00159 /* 00160 Informs handler that write_row() which tries to insert new row into the 00161 table and encounters some already existing row with same primary/unique 00162 key can replace old row with new row instead of reporting error (basically 00163 it informs handler that we do REPLACE instead of simple INSERT). 00164 Off by default. 00165 */ 00166 HA_EXTRA_WRITE_CAN_REPLACE, 00167 HA_EXTRA_WRITE_CANNOT_REPLACE 00168 }; 00169 00170 /* The following is parameter to ha_panic() */ 00171 00172 enum ha_panic_function { 00173 HA_PANIC_CLOSE, /* Close all databases */ 00174 HA_PANIC_WRITE, /* Unlock and write status */ 00175 HA_PANIC_READ /* Lock and read keyinfo */ 00176 }; 00177 00178 /* The following is parameter to ha_create(); keytypes */ 00179 00180 enum ha_base_keytype { 00181 HA_KEYTYPE_END=0, 00182 HA_KEYTYPE_TEXT=1, /* Key is sorted as letters */ 00183 HA_KEYTYPE_BINARY=2, /* Key is sorted as unsigned chars */ 00184 HA_KEYTYPE_SHORT_INT=3, 00185 HA_KEYTYPE_LONG_INT=4, 00186 HA_KEYTYPE_FLOAT=5, 00187 HA_KEYTYPE_DOUBLE=6, 00188 HA_KEYTYPE_NUM=7, /* Not packed num with pre-space */ 00189 HA_KEYTYPE_USHORT_INT=8, 00190 HA_KEYTYPE_ULONG_INT=9, 00191 HA_KEYTYPE_LONGLONG=10, 00192 HA_KEYTYPE_ULONGLONG=11, 00193 HA_KEYTYPE_INT24=12, 00194 HA_KEYTYPE_UINT24=13, 00195 HA_KEYTYPE_INT8=14, 00196 /* Varchar (0-255 bytes) with length packed with 1 byte */ 00197 HA_KEYTYPE_VARTEXT1=15, /* Key is sorted as letters */ 00198 HA_KEYTYPE_VARBINARY1=16, /* Key is sorted as unsigned chars */ 00199 /* Varchar (0-65535 bytes) with length packed with 2 bytes */ 00200 HA_KEYTYPE_VARTEXT2=17, /* Key is sorted as letters */ 00201 HA_KEYTYPE_VARBINARY2=18, /* Key is sorted as unsigned chars */ 00202 HA_KEYTYPE_BIT=19 00203 }; 00204 00205 #define HA_MAX_KEYTYPE 31 /* Must be log2-1 */ 00206 00207 /* These flags kan be OR:ed to key-flag */ 00208 00209 #define HA_NOSAME 1 /* Set if not dupplicated records */ 00210 #define HA_PACK_KEY 2 /* Pack string key to previous key */ 00211 #define HA_AUTO_KEY 16 00212 #define HA_BINARY_PACK_KEY 32 /* Packing of all keys to prev key */ 00213 #define HA_FULLTEXT 128 /* For full-text search */ 00214 #define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */ 00215 #define HA_SPATIAL 1024 /* For spatial search */ 00216 #define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */ 00217 #define HA_GENERATED_KEY 8192 /* Automaticly generated key */ 00218 00219 /* The combination of the above can be used for key type comparison. */ 00220 #define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \ 00221 HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ 00222 HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) 00223 00224 /* Automatic bits in key-flag */ 00225 00226 #define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */ 00227 #define HA_VAR_LENGTH_KEY 8 00228 #define HA_NULL_PART_KEY 64 00229 #define HA_USES_PARSER 16384 /* Fulltext index uses [pre]parser */ 00230 #define HA_USES_BLOCK_SIZE ((uint) 32768) 00231 #define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */ 00232 /* 00233 Key has a part that can have end space. If this is an unique key 00234 we have to handle it differently from other unique keys as we can find 00235 many matching rows for one key (because end space are not compared) 00236 */ 00237 #define HA_END_SPACE_KEY 4096 00238 00239 /* These flags can be added to key-seg-flag */ 00240 00241 #define HA_SPACE_PACK 1 /* Pack space in key-seg */ 00242 #define HA_PART_KEY_SEG 4 /* Used by MySQL for part-key-cols */ 00243 #define HA_VAR_LENGTH_PART 8 00244 #define HA_NULL_PART 16 00245 #define HA_BLOB_PART 32 00246 #define HA_SWAP_KEY 64 00247 #define HA_REVERSE_SORT 128 /* Sort key in reverse order */ 00248 #define HA_NO_SORT 256 /* do not bother sorting on this keyseg */ 00249 /* 00250 End space in unique/varchar are considered equal. (Like 'a' and 'a ') 00251 Only needed for internal temporary tables. 00252 */ 00253 #define HA_END_SPACE_ARE_EQUAL 512 00254 #define HA_BIT_PART 1024 00255 00256 /* optionbits for database */ 00257 #define HA_OPTION_PACK_RECORD 1 00258 #define HA_OPTION_PACK_KEYS 2 00259 #define HA_OPTION_COMPRESS_RECORD 4 00260 #define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */ 00261 #define HA_OPTION_TMP_TABLE 16 00262 #define HA_OPTION_CHECKSUM 32 00263 #define HA_OPTION_DELAY_KEY_WRITE 64 00264 #define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */ 00265 #define HA_OPTION_CREATE_FROM_ENGINE 256 00266 #define HA_OPTION_RELIES_ON_SQL_LAYER 512 00267 #define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */ 00268 #define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */ 00269 00270 /* Bits in flag to create() */ 00271 00272 #define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */ 00273 #define HA_PACK_RECORD 2 /* Request packed record format */ 00274 #define HA_CREATE_TMP_TABLE 4 00275 #define HA_CREATE_CHECKSUM 8 00276 #define HA_CREATE_DELAY_KEY_WRITE 64 00277 #define HA_CREATE_RELIES_ON_SQL_LAYER 128 00278 00279 /* 00280 The following flags (OR-ed) are passed to handler::info() method. 00281 The method copies misc handler information out of the storage engine 00282 to data structures accessible from MySQL 00283 00284 Same flags are also passed down to mi_status, myrg_status, etc. 00285 */ 00286 00287 /* this one is not used */ 00288 #define HA_STATUS_POS 1 00289 /* 00290 assuming the table keeps shared actual copy of the 'info' and 00291 local, possibly outdated copy, the following flag means that 00292 it should not try to get the actual data (locking the shared structure) 00293 slightly outdated version will suffice 00294 */ 00295 #define HA_STATUS_NO_LOCK 2 00296 /* update the time of the last modification (in handler::update_time) */ 00297 #define HA_STATUS_TIME 4 00298 /* 00299 update the 'constant' part of the info: 00300 handler::max_data_file_length, max_index_file_length, create_time 00301 sortkey, ref_length, block_size, data_file_name, index_file_name. 00302 handler::table->s->keys_in_use, keys_for_keyread, rec_per_key 00303 */ 00304 #define HA_STATUS_CONST 8 00305 /* 00306 update the 'variable' part of the info: 00307 handler::records, deleted, data_file_length, index_file_length, 00308 delete_length, check_time, mean_rec_length 00309 */ 00310 #define HA_STATUS_VARIABLE 16 00311 /* 00312 get the information about the key that caused last duplicate value error 00313 update handler::errkey and handler::dupp_ref 00314 see handler::get_dup_key() 00315 */ 00316 #define HA_STATUS_ERRKEY 32 00317 /* 00318 update handler::auto_increment_value 00319 */ 00320 #define HA_STATUS_AUTO 64 00321 00322 /* Errorcodes given by functions */ 00323 00324 /* opt_sum_query() assumes these codes are > 1 */ 00325 /* Do not add error numbers before HA_ERR_FIRST. */ 00326 /* If necessary to add lower numbers, change HA_ERR_FIRST accordingly. */ 00327 #define HA_ERR_FIRST 120 /*Copy first error nr.*/ 00328 #define HA_ERR_KEY_NOT_FOUND 120 /* Didn't find key on read or update */ 00329 #define HA_ERR_FOUND_DUPP_KEY 121 /* Dupplicate key on write */ 00330 #define HA_ERR_RECORD_CHANGED 123 /* Uppdate with is recoverable */ 00331 #define HA_ERR_WRONG_INDEX 124 /* Wrong index given to function */ 00332 #define HA_ERR_CRASHED 126 /* Indexfile is crashed */ 00333 #define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */ 00334 #define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */ 00335 #define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */ 00336 #define HA_ERR_WRONG_COMMAND 131 /* Command not supported */ 00337 #define HA_ERR_OLD_FILE 132 /* old databasfile */ 00338 #define HA_ERR_NO_ACTIVE_RECORD 133 /* No record read in update() */ 00339 #define HA_ERR_RECORD_DELETED 134 /* A record is not there */ 00340 #define HA_ERR_RECORD_FILE_FULL 135 /* No more room in file */ 00341 #define HA_ERR_INDEX_FILE_FULL 136 /* No more room in file */ 00342 #define HA_ERR_END_OF_FILE 137 /* end in next/prev/first/last */ 00343 #define HA_ERR_UNSUPPORTED 138 /* unsupported extension used */ 00344 #define HA_ERR_TO_BIG_ROW 139 /* Too big row */ 00345 #define HA_WRONG_CREATE_OPTION 140 /* Wrong create option */ 00346 #define HA_ERR_FOUND_DUPP_UNIQUE 141 /* Dupplicate unique on write */ 00347 #define HA_ERR_UNKNOWN_CHARSET 142 /* Can't open charset */ 00348 #define HA_ERR_WRONG_MRG_TABLE_DEF 143 /* conflicting MyISAM tables in MERGE */ 00349 #define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */ 00350 #define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */ 00351 #define HA_ERR_LOCK_WAIT_TIMEOUT 146 00352 #define HA_ERR_LOCK_TABLE_FULL 147 00353 #define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */ 00354 #define HA_ERR_LOCK_DEADLOCK 149 00355 #define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */ 00356 #define HA_ERR_NO_REFERENCED_ROW 151 /* Cannot add a child row */ 00357 #define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */ 00358 #define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */ 00359 #define HA_ERR_NON_UNIQUE_BLOCK_SIZE 154 /* Non unique key block size */ 00360 #define HA_ERR_NO_SUCH_TABLE 155 /* The table does not exist in engine */ 00361 #define HA_ERR_TABLE_EXIST 156 /* The table existed in storage engine */ 00362 #define HA_ERR_NO_CONNECTION 157 /* Could not connect to storage engine */ 00363 #define HA_ERR_NULL_IN_SPATIAL 158 /* NULLs are not supported in spatial index */ 00364 #define HA_ERR_TABLE_DEF_CHANGED 159 /* The table changed in storage engine */ 00365 #define HA_ERR_NO_PARTITION_FOUND 160 /* There's no partition in table for 00366 given value */ 00367 #define HA_ERR_RBR_LOGGING_FAILED 161 /* Row-based binlogging of row failed */ 00368 #define HA_ERR_DROP_INDEX_FK 162 /* Index needed in foreign key constr. */ 00369 #define HA_ERR_FOREIGN_DUPLICATE_KEY 163 /* Upholding foreign key constraints 00370 would lead to a duplicate key 00371 error in some other table. */ 00372 #define HA_ERR_TABLE_NEEDS_UPGRADE 164 /* The table changed in storage engine */ 00373 #define HA_ERR_TABLE_READONLY 165 /* The table is not writable */ 00374 00375 #define HA_ERR_LAST 165 /*Copy last error nr.*/ 00376 /* Add error numbers before HA_ERR_LAST and change it accordingly. */ 00377 #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) 00378 00379 /* Other constants */ 00380 00381 #define HA_NAMELEN 64 /* Max length of saved filename */ 00382 #define NO_SUCH_KEY ((uint)~0) /* used as a key no. */ 00383 00384 /* Intern constants in databases */ 00385 00386 /* bits in _search */ 00387 #define SEARCH_FIND 1 00388 #define SEARCH_NO_FIND 2 00389 #define SEARCH_SAME 4 00390 #define SEARCH_BIGGER 8 00391 #define SEARCH_SMALLER 16 00392 #define SEARCH_SAVE_BUFF 32 00393 #define SEARCH_UPDATE 64 00394 #define SEARCH_PREFIX 128 00395 #define SEARCH_LAST 256 00396 #define MBR_CONTAIN 512 00397 #define MBR_INTERSECT 1024 00398 #define MBR_WITHIN 2048 00399 #define MBR_DISJOINT 4096 00400 #define MBR_EQUAL 8192 00401 #define MBR_DATA 16384 00402 #define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */ 00403 #define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */ 00404 00405 /* bits in opt_flag */ 00406 #define QUICK_USED 1 00407 #define READ_CACHE_USED 2 00408 #define READ_CHECK_USED 4 00409 #define KEY_READ_USED 8 00410 #define WRITE_CACHE_USED 16 00411 #define OPT_NO_ROWS 32 00412 00413 /* bits in update */ 00414 #define HA_STATE_CHANGED 1 /* Database has changed */ 00415 #define HA_STATE_AKTIV 2 /* Has a current record */ 00416 #define HA_STATE_WRITTEN 4 /* Record is written */ 00417 #define HA_STATE_DELETED 8 00418 #define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */ 00419 #define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */ 00420 #define HA_STATE_NO_KEY 64 /* Last read didn't find record */ 00421 #define HA_STATE_KEY_CHANGED 128 00422 #define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */ 00423 #define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */ 00424 #define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */ 00425 #define HA_STATE_EXTEND_BLOCK 2048 00426 #define HA_STATE_RNEXT_SAME 4096 /* rnext_same occupied lastkey2 */ 00427 00428 /* myisampack expects no more than 32 field types. */ 00429 enum en_fieldtype { 00430 FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE, 00431 FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO, 00432 FIELD_VARCHAR,FIELD_CHECK, 00433 FIELD_enum_val_count 00434 }; 00435 00436 enum data_file_type { 00437 STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD 00438 }; 00439 00440 /* For key ranges */ 00441 00442 #define NO_MIN_RANGE 1 00443 #define NO_MAX_RANGE 2 00444 #define NEAR_MIN 4 00445 #define NEAR_MAX 8 00446 #define UNIQUE_RANGE 16 00447 #define EQ_RANGE 32 00448 #define NULL_RANGE 64 00449 #define GEOM_FLAG 128 00450 #define SKIP_RANGE 256 00451 00452 typedef struct st_key_range 00453 { 00454 const byte *key; 00455 uint length; 00456 enum ha_rkey_function flag; 00457 } key_range; 00458 00459 typedef struct st_key_multi_range 00460 { 00461 key_range start_key; 00462 key_range end_key; 00463 char *ptr; /* Free to use by caller (ptr to row etc) */ 00464 uint range_flag; /* key range flags see above */ 00465 } KEY_MULTI_RANGE; 00466 00467 00468 /* For number of records */ 00469 #ifdef BIG_TABLES 00470 #define rows2double(A) ulonglong2double(A) 00471 typedef my_off_t ha_rows; 00472 #else 00473 #define rows2double(A) (double) (A) 00474 typedef ulong ha_rows; 00475 #endif 00476 00477 #define HA_POS_ERROR (~ (ha_rows) 0) 00478 #define HA_OFFSET_ERROR (~ (my_off_t) 0) 00479 00480 #if SYSTEM_SIZEOF_OFF_T == 4 00481 #define MAX_FILE_SIZE INT_MAX32 00482 #else 00483 #define MAX_FILE_SIZE LONGLONG_MAX 00484 #endif 00485 00486 #define HA_VARCHAR_PACKLENGTH(field_length) ((field_length) < 256 ? 1 :2) 00487 00488 #endif /* _my_base_h */
1.4.7

