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