You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

519 lines
20 KiB

26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
25 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
24 years ago
24 years ago
26 years ago
26 years ago
26 years ago
20 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
24 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
26 years ago
  1. /* Copyright (C) 2000 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. /* This file should be included when using myisam_funktions */
  13. #ifndef _myisam_h
  14. #define _myisam_h
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #ifndef _my_base_h
  19. #include <my_base.h>
  20. #endif
  21. #ifndef _m_ctype_h
  22. #include <m_ctype.h>
  23. #endif
  24. #ifndef _keycache_h
  25. #include "keycache.h"
  26. #endif
  27. #include "my_handler.h"
  28. /*
  29. There is a hard limit for the maximum number of keys as there are only
  30. 8 bits in the index file header for the number of keys in a table.
  31. This means that 0..255 keys can exist for a table. The idea of
  32. MI_MAX_POSSIBLE_KEY is to ensure that one can use myisamchk & tools on
  33. a MyISAM table for which one has more keys than MyISAM is normally
  34. compiled for. If you don't have this, you will get a core dump when
  35. running myisamchk compiled for 128 keys on a table with 255 keys.
  36. */
  37. #define MI_MAX_POSSIBLE_KEY 255 /* For myisam_chk */
  38. #if MAX_INDEXES > MI_MAX_POSSIBLE_KEY
  39. #define MI_MAX_KEY MI_MAX_POSSIBLE_KEY /* Max allowed keys */
  40. #else
  41. #define MI_MAX_KEY MAX_INDEXES /* Max allowed keys */
  42. #endif
  43. #define MI_MAX_POSSIBLE_KEY_BUFF (1024+6+6) /* For myisam_chk */
  44. /*
  45. The following defines can be increased if necessary.
  46. But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
  47. */
  48. #define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */
  49. #define MI_MAX_KEY_SEG 16 /* Max segments for key */
  50. #define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
  51. #define MI_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
  52. #define MI_NAME_IEXT ".MYI"
  53. #define MI_NAME_DEXT ".MYD"
  54. /* Max extra space to use when sorting keys */
  55. #define MI_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
  56. /* Possible values for myisam_block_size (must be power of 2) */
  57. #define MI_KEY_BLOCK_LENGTH 1024 /* default key block length */
  58. #define MI_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */
  59. #define MI_MAX_KEY_BLOCK_LENGTH 16384
  60. #define mi_portable_sizeof_char_ptr 8
  61. /*
  62. In the following macros '_keyno_' is 0 .. keys-1.
  63. If there can be more keys than bits in the key_map, the highest bit
  64. is for all upper keys. They cannot be switched individually.
  65. This means that clearing of high keys is ignored, setting one high key
  66. sets all high keys.
  67. */
  68. #define MI_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
  69. #define MI_KEYMAP_HIGH_MASK (ULL(1) << (MI_KEYMAP_BITS - 1))
  70. #define mi_get_mask_all_keys_active(_keys_) \
  71. (((_keys_) < MI_KEYMAP_BITS) ? \
  72. ((ULL(1) << (_keys_)) - ULL(1)) : \
  73. (~ ULL(0)))
  74. #if MI_MAX_KEY > MI_KEYMAP_BITS
  75. #define mi_is_key_active(_keymap_,_keyno_) \
  76. (((_keyno_) < MI_KEYMAP_BITS) ? \
  77. test((_keymap_) & (ULL(1) << (_keyno_))) : \
  78. test((_keymap_) & MI_KEYMAP_HIGH_MASK))
  79. #define mi_set_key_active(_keymap_,_keyno_) \
  80. (_keymap_)|= (((_keyno_) < MI_KEYMAP_BITS) ? \
  81. (ULL(1) << (_keyno_)) : \
  82. MI_KEYMAP_HIGH_MASK)
  83. #define mi_clear_key_active(_keymap_,_keyno_) \
  84. (_keymap_)&= (((_keyno_) < MI_KEYMAP_BITS) ? \
  85. (~ (ULL(1) << (_keyno_))) : \
  86. (~ (ULL(0))) /*ignore*/ )
  87. #else
  88. #define mi_is_key_active(_keymap_,_keyno_) \
  89. test((_keymap_) & (ULL(1) << (_keyno_)))
  90. #define mi_set_key_active(_keymap_,_keyno_) \
  91. (_keymap_)|= (ULL(1) << (_keyno_))
  92. #define mi_clear_key_active(_keymap_,_keyno_) \
  93. (_keymap_)&= (~ (ULL(1) << (_keyno_)))
  94. #endif
  95. #define mi_is_any_key_active(_keymap_) \
  96. test((_keymap_))
  97. #define mi_is_all_keys_active(_keymap_,_keys_) \
  98. ((_keymap_) == mi_get_mask_all_keys_active(_keys_))
  99. #define mi_set_all_keys_active(_keymap_,_keys_) \
  100. (_keymap_)= mi_get_mask_all_keys_active(_keys_)
  101. #define mi_clear_all_keys_active(_keymap_) \
  102. (_keymap_)= 0
  103. #define mi_intersect_keys_active(_to_,_from_) \
  104. (_to_)&= (_from_)
  105. #define mi_is_any_intersect_keys_active(_keymap1_,_keys_,_keymap2_) \
  106. ((_keymap1_) & (_keymap2_) & \
  107. mi_get_mask_all_keys_active(_keys_))
  108. #define mi_copy_keys_active(_to_,_maxkeys_,_from_) \
  109. (_to_)= (mi_get_mask_all_keys_active(_maxkeys_) & \
  110. (_from_))
  111. /* Param to/from mi_info */
  112. typedef struct st_mi_isaminfo /* Struct from h_info */
  113. {
  114. ha_rows records; /* Records in database */
  115. ha_rows deleted; /* Deleted records in database */
  116. my_off_t recpos; /* Pos for last used record */
  117. my_off_t newrecpos; /* Pos if we write new record */
  118. my_off_t dupp_key_pos; /* Position to record with dupp key */
  119. my_off_t data_file_length, /* Length of data file */
  120. max_data_file_length,
  121. index_file_length,
  122. max_index_file_length,
  123. delete_length;
  124. ulong reclength; /* Recordlength */
  125. ulong mean_reclength; /* Mean recordlength (if packed) */
  126. ulonglong auto_increment;
  127. ulonglong key_map; /* Which keys are used */
  128. char *data_file_name, *index_file_name;
  129. uint keys; /* Number of keys in use */
  130. uint options; /* HA_OPTION_... used */
  131. int errkey, /* With key was dupplicated on err */
  132. sortkey; /* clustered by this key */
  133. File filenr; /* (uniq) filenr for datafile */
  134. time_t create_time; /* When table was created */
  135. time_t check_time;
  136. time_t update_time;
  137. uint reflength;
  138. ulong record_offset;
  139. ulong *rec_per_key; /* for sql optimizing */
  140. uint raid_type,raid_chunks;
  141. ulong raid_chunksize;
  142. } MI_ISAMINFO;
  143. typedef struct st_mi_create_info
  144. {
  145. const char *index_file_name, *data_file_name; /* If using symlinks */
  146. ha_rows max_rows;
  147. ha_rows reloc_rows;
  148. ulonglong auto_increment;
  149. ulonglong data_file_length;
  150. ulonglong key_file_length;
  151. uint raid_type,raid_chunks;
  152. ulong raid_chunksize;
  153. uint old_options;
  154. uint8 language;
  155. my_bool with_auto_increment;
  156. } MI_CREATE_INFO;
  157. struct st_myisam_info; /* For referense */
  158. struct st_mi_isam_share;
  159. typedef struct st_myisam_info MI_INFO;
  160. struct st_mi_s_param;
  161. typedef struct st_mi_keydef /* Key definition with open & info */
  162. {
  163. struct st_mi_isam_share *share; /* Pointer to base (set in mi_open) */
  164. uint16 keysegs; /* Number of key-segment */
  165. uint16 flag; /* NOSAME, PACK_USED */
  166. uint8 key_alg; /* BTREE, RTREE */
  167. uint16 block_length; /* Length of keyblock (auto) */
  168. uint16 underflow_block_length; /* When to execute underflow */
  169. uint16 keylength; /* Tot length of keyparts (auto) */
  170. uint16 minlength; /* min length of (packed) key (auto) */
  171. uint16 maxlength; /* max length of (packed) key (auto) */
  172. uint16 block_size; /* block_size (auto) */
  173. uint32 version; /* For concurrent read/write */
  174. HA_KEYSEG *seg,*end;
  175. int (*bin_search)(struct st_myisam_info *info,struct st_mi_keydef *keyinfo,
  176. uchar *page,uchar *key,
  177. uint key_len,uint comp_flag,uchar * *ret_pos,
  178. uchar *buff, my_bool *was_last_key);
  179. uint (*get_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar * *page,
  180. uchar *key);
  181. int (*pack_key)(struct st_mi_keydef *keyinfo,uint nod_flag,uchar *next_key,
  182. uchar *org_key, uchar *prev_key, uchar *key,
  183. struct st_mi_s_param *s_temp);
  184. void (*store_key)(struct st_mi_keydef *keyinfo, uchar *key_pos,
  185. struct st_mi_s_param *s_temp);
  186. int (*ck_insert)(struct st_myisam_info *inf, uint k_nr, uchar *k, uint klen);
  187. int (*ck_delete)(struct st_myisam_info *inf, uint k_nr, uchar *k, uint klen);
  188. } MI_KEYDEF;
  189. #define MI_UNIQUE_HASH_LENGTH 4
  190. typedef struct st_unique_def /* Segment definition of unique */
  191. {
  192. uint16 keysegs; /* Number of key-segment */
  193. uchar key; /* Mapped to which key */
  194. uint8 null_are_equal;
  195. HA_KEYSEG *seg,*end;
  196. } MI_UNIQUEDEF;
  197. typedef struct st_mi_decode_tree /* Decode huff-table */
  198. {
  199. uint16 *table;
  200. uint quick_table_bits;
  201. byte *intervalls;
  202. } MI_DECODE_TREE;
  203. struct st_mi_bit_buff;
  204. /*
  205. Note that null markers should always be first in a row !
  206. When creating a column, one should only specify:
  207. type, length, null_bit and null_pos
  208. */
  209. typedef struct st_columndef /* column information */
  210. {
  211. int16 type; /* en_fieldtype */
  212. uint16 length; /* length of field */
  213. uint32 offset; /* Offset to position in row */
  214. uint8 null_bit; /* If column may be 0 */
  215. uint16 null_pos; /* position for null marker */
  216. #ifndef NOT_PACKED_DATABASES
  217. void (*unpack)(struct st_columndef *rec,struct st_mi_bit_buff *buff,
  218. uchar *start,uchar *end);
  219. enum en_fieldtype base_type;
  220. uint space_length_bits,pack_type;
  221. MI_DECODE_TREE *huff_tree;
  222. #endif
  223. } MI_COLUMNDEF;
  224. /* invalidator function reference for Query Cache */
  225. typedef void (* invalidator_by_filename)(const char * filename);
  226. extern my_string myisam_log_filename; /* Name of logfile */
  227. extern ulong myisam_block_size;
  228. extern ulong myisam_concurrent_insert;
  229. extern my_bool myisam_flush,myisam_delay_key_write,myisam_single_user;
  230. extern my_off_t myisam_max_temp_length;
  231. extern ulong myisam_bulk_insert_tree_size, myisam_data_pointer_size;
  232. /* Prototypes for myisam-functions */
  233. extern int mi_close(struct st_myisam_info *file);
  234. extern int mi_delete(struct st_myisam_info *file,const byte *buff);
  235. extern struct st_myisam_info *mi_open(const char *name,int mode,
  236. uint wait_if_locked);
  237. extern int mi_panic(enum ha_panic_function function);
  238. extern int mi_rfirst(struct st_myisam_info *file,byte *buf,int inx);
  239. extern int mi_rkey(struct st_myisam_info *file,byte *buf,int inx,
  240. const byte *key,
  241. uint key_len, enum ha_rkey_function search_flag);
  242. extern int mi_rlast(struct st_myisam_info *file,byte *buf,int inx);
  243. extern int mi_rnext(struct st_myisam_info *file,byte *buf,int inx);
  244. extern int mi_rnext_same(struct st_myisam_info *info, byte *buf);
  245. extern int mi_rprev(struct st_myisam_info *file,byte *buf,int inx);
  246. extern int mi_rrnd(struct st_myisam_info *file,byte *buf, my_off_t pos);
  247. extern int mi_scan_init(struct st_myisam_info *file);
  248. extern int mi_scan(struct st_myisam_info *file,byte *buf);
  249. extern int mi_rsame(struct st_myisam_info *file,byte *record,int inx);
  250. extern int mi_rsame_with_pos(struct st_myisam_info *file,byte *record,
  251. int inx, my_off_t pos);
  252. extern int mi_update(struct st_myisam_info *file,const byte *old,
  253. byte *new_record);
  254. extern int mi_write(struct st_myisam_info *file,byte *buff);
  255. extern my_off_t mi_position(struct st_myisam_info *file);
  256. extern int mi_status(struct st_myisam_info *info, MI_ISAMINFO *x, uint flag);
  257. extern int mi_lock_database(struct st_myisam_info *file,int lock_type);
  258. extern int mi_create(const char *name,uint keys,MI_KEYDEF *keydef,
  259. uint columns, MI_COLUMNDEF *columndef,
  260. uint uniques, MI_UNIQUEDEF *uniquedef,
  261. MI_CREATE_INFO *create_info, uint flags);
  262. extern int mi_delete_table(const char *name);
  263. extern int mi_rename(const char *from, const char *to);
  264. extern int mi_extra(struct st_myisam_info *file,
  265. enum ha_extra_function function,
  266. void *extra_arg);
  267. extern ha_rows mi_records_in_range(struct st_myisam_info *info,int inx,
  268. key_range *min_key, key_range *max_key);
  269. extern int mi_log(int activate_log);
  270. extern int mi_is_changed(struct st_myisam_info *info);
  271. extern int mi_delete_all_rows(struct st_myisam_info *info);
  272. extern ulong _mi_calc_blob_length(uint length , const byte *pos);
  273. extern uint mi_get_pointer_length(ulonglong file_length, uint def);
  274. /* this is used to pass to mysql_myisamchk_table -- by Sasha Pachev */
  275. #define MYISAMCHK_REPAIR 1 /* equivalent to myisamchk -r */
  276. #define MYISAMCHK_VERIFY 2 /* Verify, run repair if failure */
  277. /*
  278. Definitions needed for myisamchk.c
  279. Entries marked as "QQ to be removed" are NOT used to
  280. pass check/repair options to mi_check.c. They are used
  281. internally by myisamchk.c or/and ha_myisam.cc and should NOT
  282. be stored together with other flags. They should be removed
  283. from the following list to make addition of new flags possible.
  284. */
  285. #define T_AUTO_INC 1
  286. #define T_AUTO_REPAIR 2 /* QQ to be removed */
  287. #define T_BACKUP_DATA 4
  288. #define T_CALC_CHECKSUM 8
  289. #define T_CHECK 16 /* QQ to be removed */
  290. #define T_CHECK_ONLY_CHANGED 32 /* QQ to be removed */
  291. #define T_CREATE_MISSING_KEYS 64
  292. #define T_DESCRIPT 128
  293. #define T_DONT_CHECK_CHECKSUM 256
  294. #define T_EXTEND 512
  295. #define T_FAST (1L << 10) /* QQ to be removed */
  296. #define T_FORCE_CREATE (1L << 11) /* QQ to be removed */
  297. #define T_FORCE_UNIQUENESS (1L << 12)
  298. #define T_INFO (1L << 13)
  299. #define T_MEDIUM (1L << 14)
  300. #define T_QUICK (1L << 15) /* QQ to be removed */
  301. #define T_READONLY (1L << 16) /* QQ to be removed */
  302. #define T_REP (1L << 17)
  303. #define T_REP_BY_SORT (1L << 18) /* QQ to be removed */
  304. #define T_REP_PARALLEL (1L << 19) /* QQ to be removed */
  305. #define T_RETRY_WITHOUT_QUICK (1L << 20)
  306. #define T_SAFE_REPAIR (1L << 21)
  307. #define T_SILENT (1L << 22)
  308. #define T_SORT_INDEX (1L << 23) /* QQ to be removed */
  309. #define T_SORT_RECORDS (1L << 24) /* QQ to be removed */
  310. #define T_STATISTICS (1L << 25)
  311. #define T_UNPACK (1L << 26)
  312. #define T_UPDATE_STATE (1L << 27)
  313. #define T_VERBOSE (1L << 28)
  314. #define T_VERY_SILENT (1L << 29)
  315. #define T_WAIT_FOREVER (1L << 30)
  316. #define T_WRITE_LOOP ((ulong) 1L << 31)
  317. #define T_REP_ANY (T_REP | T_REP_BY_SORT | T_REP_PARALLEL)
  318. /*
  319. Flags used by myisamchk.c or/and ha_myisam.cc that are NOT passed
  320. to mi_check.c follows:
  321. */
  322. #define TT_USEFRM 1
  323. #define TT_FOR_UPGRADE 2
  324. #define O_NEW_INDEX 1 /* Bits set in out_flag */
  325. #define O_NEW_DATA 2
  326. #define O_DATA_LOST 4
  327. /* these struct is used by my_check to tell it what to do */
  328. typedef struct st_sort_key_blocks /* Used when sorting */
  329. {
  330. uchar *buff,*end_pos;
  331. uchar lastkey[MI_MAX_POSSIBLE_KEY_BUFF];
  332. uint last_length;
  333. int inited;
  334. } SORT_KEY_BLOCKS;
  335. /*
  336. MyISAM supports several statistics collection methods. Currently statistics
  337. collection method is not stored in MyISAM file and has to be specified for
  338. each table analyze/repair operation in MI_CHECK::stats_method.
  339. */
  340. typedef enum
  341. {
  342. /* Treat NULLs as inequal when collecting statistics (default for 4.1/5.0) */
  343. MI_STATS_METHOD_NULLS_NOT_EQUAL,
  344. /* Treat NULLs as equal when collecting statistics (like 4.0 did) */
  345. MI_STATS_METHOD_NULLS_EQUAL,
  346. /* Ignore NULLs - count only tuples without NULLs in the index components */
  347. MI_STATS_METHOD_IGNORE_NULLS
  348. } enum_mi_stats_method;
  349. typedef struct st_mi_check_param
  350. {
  351. ulonglong auto_increment_value;
  352. ulonglong max_data_file_length;
  353. ulonglong keys_in_use;
  354. ulonglong max_record_length;
  355. my_off_t search_after_block;
  356. my_off_t new_file_pos,key_file_blocks;
  357. my_off_t keydata,totaldata,key_blocks,start_check_pos;
  358. ha_rows total_records,total_deleted;
  359. ha_checksum record_checksum,glob_crc;
  360. ulong use_buffers,read_buffer_length,write_buffer_length,
  361. sort_buffer_length,sort_key_blocks;
  362. uint out_flag,warning_printed,error_printed,verbose;
  363. uint opt_sort_key,total_files,max_level;
  364. uint testflag, key_cache_block_size;
  365. uint8 language;
  366. my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
  367. my_bool retry_repair, force_sort;
  368. char temp_filename[FN_REFLEN],*isam_file_name;
  369. MY_TMPDIR *tmpdir;
  370. int tmpfile_createflag;
  371. myf myf_rw;
  372. IO_CACHE read_cache;
  373. /*
  374. The next two are used to collect statistics, see update_key_parts for
  375. description.
  376. */
  377. ulonglong unique_count[MI_MAX_KEY_SEG+1];
  378. ulonglong notnull_count[MI_MAX_KEY_SEG+1];
  379. ha_checksum key_crc[MI_MAX_POSSIBLE_KEY];
  380. ulong rec_per_key_part[MI_MAX_KEY_SEG*MI_MAX_POSSIBLE_KEY];
  381. void *thd;
  382. const char *db_name, *table_name;
  383. const char *op_name;
  384. enum_mi_stats_method stats_method;
  385. } MI_CHECK;
  386. typedef struct st_sort_ft_buf
  387. {
  388. uchar *buf, *end;
  389. int count;
  390. uchar lastkey[MI_MAX_KEY_BUFF];
  391. } SORT_FT_BUF;
  392. typedef struct st_sort_info
  393. {
  394. my_off_t filelength,dupp,buff_length;
  395. ha_rows max_records;
  396. uint current_key, total_keys;
  397. myf myf_rw;
  398. enum data_file_type new_data_file_type;
  399. MI_INFO *info;
  400. MI_CHECK *param;
  401. char *buff;
  402. SORT_KEY_BLOCKS *key_block,*key_block_end;
  403. SORT_FT_BUF *ft_buf;
  404. /* sync things */
  405. uint got_error, threads_running;
  406. #ifdef THREAD
  407. pthread_mutex_t mutex;
  408. pthread_cond_t cond;
  409. #endif
  410. } SORT_INFO;
  411. /* functions in mi_check */
  412. void myisamchk_init(MI_CHECK *param);
  413. int chk_status(MI_CHECK *param, MI_INFO *info);
  414. int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag);
  415. int chk_size(MI_CHECK *param, MI_INFO *info);
  416. int chk_key(MI_CHECK *param, MI_INFO *info);
  417. int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend);
  418. int mi_repair(MI_CHECK *param, register MI_INFO *info,
  419. my_string name, int rep_quick);
  420. int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name);
  421. int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
  422. const char * name, int rep_quick);
  423. int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
  424. const char * name, int rep_quick);
  425. int change_to_newfile(const char * filename, const char * old_ext,
  426. const char * new_ext, uint raid_chunks,
  427. myf myflags);
  428. int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
  429. const char *filetype, const char *filename);
  430. void lock_memory(MI_CHECK *param);
  431. void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
  432. my_bool repair);
  433. int update_state_info(MI_CHECK *param, MI_INFO *info,uint update);
  434. void update_key_parts(MI_KEYDEF *keyinfo, ulong *rec_per_key_part,
  435. ulonglong *unique, ulonglong *notnull,
  436. ulonglong records);
  437. int filecopy(MI_CHECK *param, File to,File from,my_off_t start,
  438. my_off_t length, const char *type);
  439. int movepoint(MI_INFO *info,byte *record,my_off_t oldpos,
  440. my_off_t newpos, uint prot_key);
  441. int write_data_suffix(SORT_INFO *sort_info, my_bool fix_datafile);
  442. int test_if_almost_full(MI_INFO *info);
  443. int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename);
  444. void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows);
  445. my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map,
  446. my_bool force);
  447. int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows);
  448. void mi_flush_bulk_insert(MI_INFO *info, uint inx);
  449. void mi_end_bulk_insert(MI_INFO *info);
  450. int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map,
  451. KEY_CACHE *key_cache);
  452. void mi_change_key_cache(KEY_CACHE *old_key_cache,
  453. KEY_CACHE *new_key_cache);
  454. int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves);
  455. #ifdef __cplusplus
  456. }
  457. #endif
  458. #endif