117
117
ulong min_block_length;
118
118
ulong fields, /* fields in table */
119
119
pack_fields; /* packed fields in table */
120
uint rec_reflength; /* = 2-8 */
121
uint key_reflength; /* = 2-8 */
122
uint keys; /* same as in state.header */
123
uint auto_key; /* Which key-1 is a auto key */
124
uint blobs; /* Number of blobs */
125
uint pack_bits; /* Length of packed bits */
126
uint max_key_block_length; /* Max block length */
127
uint max_key_length; /* Max key length */
120
uint32_t rec_reflength; /* = 2-8 */
121
uint32_t key_reflength; /* = 2-8 */
122
uint32_t keys; /* same as in state.header */
123
uint32_t auto_key; /* Which key-1 is a auto key */
124
uint32_t blobs; /* Number of blobs */
125
uint32_t pack_bits; /* Length of packed bits */
126
uint32_t max_key_block_length; /* Max block length */
127
uint32_t max_key_length; /* Max key length */
128
128
/* Extra allocation when using dynamic record format */
129
uint extra_alloc_bytes;
130
uint extra_alloc_procent;
129
uint32_t extra_alloc_bytes;
130
uint32_t extra_alloc_procent;
131
131
/* Info about raid */
132
uint raid_type,raid_chunks;
132
uint32_t raid_type,raid_chunks;
133
133
ulong raid_chunksize;
134
134
/* The following are from the header */
135
uint key_parts,all_key_parts;
135
uint32_t key_parts,all_key_parts;
267
267
as they are not compatible with parallel repair */
268
268
ulong packed_length,blob_length; /* Length of found, packed record */
269
269
int dfile; /* The datafile */
270
uint opt_flag; /* Optim. for space/speed */
271
uint update; /* If file changed since open */
270
uint32_t opt_flag; /* Optim. for space/speed */
271
uint32_t update; /* If file changed since open */
272
272
int lastinx; /* Last used index */
273
273
uint lastkey_length; /* Length of key in lastkey */
274
274
uint last_rkey_length; /* Last length in mi_rkey() */
275
275
enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */
276
uint save_lastkey_length;
277
uint pack_key_length; /* For MYISAMMRG */
276
uint32_t save_lastkey_length;
277
uint32_t pack_key_length; /* For MYISAMMRG */
278
278
uint16_t last_used_keyseg; /* For MyISAMMRG */
279
279
int errkey; /* Got last error on this key */
280
280
int lock_type; /* How database was locked */
494
494
extern int _mi_delete_static_record(MI_INFO *info);
495
495
extern int _mi_cmp_static_record(MI_INFO *info,const unsigned char *record);
496
496
extern int _mi_read_rnd_static_record(MI_INFO*, unsigned char *,my_off_t, bool);
497
extern int _mi_ck_write(MI_INFO *info,uint keynr,unsigned char *key,uint length);
497
extern int _mi_ck_write(MI_INFO *info,uint32_t keynr,unsigned char *key,uint32_t length);
498
498
extern int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo,
499
unsigned char *key, uint key_length,
500
my_off_t *root, uint comp_flag);
499
unsigned char *key, uint32_t key_length,
500
my_off_t *root, uint32_t comp_flag);
501
501
extern int _mi_enlarge_root(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *key, my_off_t *root);
502
502
extern int _mi_insert(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *key,
503
503
unsigned char *anc_buff,unsigned char *key_pos,unsigned char *key_buff,
505
505
my_off_t father_page, bool insert_last);
506
506
extern int _mi_split_page(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *key,
507
507
unsigned char *buff,unsigned char *key_buff, bool insert_last);
508
extern unsigned char *_mi_find_half_pos(uint nod_flag,MI_KEYDEF *keyinfo,unsigned char *page,
509
unsigned char *key,uint *return_key_length,
508
extern unsigned char *_mi_find_half_pos(uint32_t nod_flag,MI_KEYDEF *keyinfo,unsigned char *page,
509
unsigned char *key,uint32_t *return_key_length,
510
510
unsigned char **after_key);
511
extern int _mi_calc_static_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
511
extern int _mi_calc_static_key_length(MI_KEYDEF *keyinfo,uint32_t nod_flag,
512
512
unsigned char *key_pos, unsigned char *org_key,
513
513
unsigned char *key_buff,
514
514
unsigned char *key, MI_KEY_PARAM *s_temp);
515
extern int _mi_calc_var_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
515
extern int _mi_calc_var_key_length(MI_KEYDEF *keyinfo,uint32_t nod_flag,
516
516
unsigned char *key_pos, unsigned char *org_key,
517
517
unsigned char *key_buff,
518
518
unsigned char *key, MI_KEY_PARAM *s_temp);
519
extern int _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
519
extern int _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint32_t nod_flag,
520
520
unsigned char *key_pos, unsigned char *org_key,
521
521
unsigned char *prev_key,
522
522
unsigned char *key, MI_KEY_PARAM *s_temp);
523
extern int _mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,
523
extern int _mi_calc_bin_pack_key_length(MI_KEYDEF *keyinfo,uint32_t nod_flag,
524
524
unsigned char *key_pos,unsigned char *org_key,
525
525
unsigned char *prev_key,
526
526
unsigned char *key, MI_KEY_PARAM *s_temp);
535
535
void _mi_store_bin_pack_key(MI_KEYDEF *keyinfo, unsigned char *key_pos,
536
536
MI_KEY_PARAM *s_temp);
538
extern int _mi_ck_delete(MI_INFO *info,uint keynr,unsigned char *key,uint key_length);
538
extern int _mi_ck_delete(MI_INFO *info,uint32_t keynr,unsigned char *key,uint32_t key_length);
539
539
extern int _mi_readinfo(MI_INFO *info,int lock_flag,int check_keybuffer);
540
extern int _mi_writeinfo(MI_INFO *info,uint options);
540
extern int _mi_writeinfo(MI_INFO *info,uint32_t options);
541
541
extern int _mi_test_if_changed(MI_INFO *info);
542
542
extern int _mi_mark_file_changed(MI_INFO *info);
543
543
extern int _mi_decrement_open_count(MI_INFO *info);
544
544
extern int _mi_check_index(MI_INFO *info,int inx);
545
extern int _mi_search(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *key,uint key_len,
546
uint nextflag,my_off_t pos);
545
extern int _mi_search(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *key,uint32_t key_len,
546
uint32_t nextflag,my_off_t pos);
547
547
extern int _mi_bin_search(struct st_myisam_info *info,MI_KEYDEF *keyinfo,
548
unsigned char *page,unsigned char *key,uint key_len,uint comp_flag,
548
unsigned char *page,unsigned char *key,uint32_t key_len,uint32_t comp_flag,
549
549
unsigned char * *ret_pos,unsigned char *buff, bool *was_last_key);
550
550
extern int _mi_seq_search(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *page,
551
unsigned char *key,uint key_len,uint comp_flag,
551
unsigned char *key,uint32_t key_len,uint32_t comp_flag,
552
552
unsigned char **ret_pos,unsigned char *buff, bool *was_last_key);
553
553
extern int _mi_prefix_search(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *page,
554
unsigned char *key,uint key_len,uint comp_flag,
554
unsigned char *key,uint32_t key_len,uint32_t comp_flag,
555
555
unsigned char **ret_pos,unsigned char *buff, bool *was_last_key);
556
extern my_off_t _mi_kpos(uint nod_flag,unsigned char *after_key);
556
extern my_off_t _mi_kpos(uint32_t nod_flag,unsigned char *after_key);
557
557
extern void _mi_kpointer(MI_INFO *info,unsigned char *buff,my_off_t pos);
558
extern my_off_t _mi_dpos(MI_INFO *info, uint nod_flag,unsigned char *after_key);
558
extern my_off_t _mi_dpos(MI_INFO *info, uint32_t nod_flag,unsigned char *after_key);
559
559
extern my_off_t _mi_rec_pos(MYISAM_SHARE *info, unsigned char *ptr);
560
560
extern void _mi_dpointer(MI_INFO *info, unsigned char *buff,my_off_t pos);
561
extern uint _mi_get_static_key(MI_KEYDEF *keyinfo,uint nod_flag,unsigned char * *page,
561
extern uint32_t _mi_get_static_key(MI_KEYDEF *keyinfo,uint32_t nod_flag,unsigned char * *page,
562
562
unsigned char *key);
563
extern uint _mi_get_pack_key(MI_KEYDEF *keyinfo,uint nod_flag,unsigned char * *page,
563
extern uint32_t _mi_get_pack_key(MI_KEYDEF *keyinfo,uint32_t nod_flag,unsigned char * *page,
564
564
unsigned char *key);
565
extern uint _mi_get_binary_pack_key(MI_KEYDEF *keyinfo, uint nod_flag,
565
extern uint32_t _mi_get_binary_pack_key(MI_KEYDEF *keyinfo, uint32_t nod_flag,
566
566
unsigned char **page_pos, unsigned char *key);
567
567
extern unsigned char *_mi_get_last_key(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *keypos,
568
568
unsigned char *lastkey,unsigned char *endpos,
569
uint *return_key_length);
569
uint32_t *return_key_length);
570
570
extern unsigned char *_mi_get_key(MI_INFO *info, MI_KEYDEF *keyinfo, unsigned char *page,
571
unsigned char *key, unsigned char *keypos, uint *return_key_length);
572
extern uint _mi_keylength(MI_KEYDEF *keyinfo,unsigned char *key);
573
extern uint _mi_keylength_part(MI_KEYDEF *keyinfo, register unsigned char *key,
571
unsigned char *key, unsigned char *keypos, uint32_t *return_key_length);
572
extern uint32_t _mi_keylength(MI_KEYDEF *keyinfo,unsigned char *key);
573
extern uint32_t _mi_keylength_part(MI_KEYDEF *keyinfo, register unsigned char *key,
575
575
extern unsigned char *_mi_move_key(MI_KEYDEF *keyinfo,unsigned char *to,unsigned char *from);
576
576
extern int _mi_search_next(MI_INFO *info,MI_KEYDEF *keyinfo,unsigned char *key,
577
uint key_length,uint nextflag,my_off_t pos);
577
uint32_t key_length,uint32_t nextflag,my_off_t pos);
578
578
extern int _mi_search_first(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos);
579
579
extern int _mi_search_last(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos);
580
580
extern unsigned char *_mi_fetch_keypage(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t page,
584
584
extern int _mi_dispose(MI_INFO *info,MI_KEYDEF *keyinfo,my_off_t pos,
586
586
extern my_off_t _mi_new(MI_INFO *info,MI_KEYDEF *keyinfo,int level);
587
extern uint _mi_make_key(MI_INFO *info,uint keynr,unsigned char *key,
587
extern uint32_t _mi_make_key(MI_INFO *info,uint32_t keynr,unsigned char *key,
588
588
const unsigned char *record,my_off_t filepos);
589
extern uint _mi_pack_key(register MI_INFO *info, uint keynr, unsigned char *key,
589
extern uint32_t _mi_pack_key(register MI_INFO *info, uint32_t keynr, unsigned char *key,
590
590
unsigned char *old, key_part_map keypart_map,
591
591
HA_KEYSEG **last_used_keyseg);
592
592
extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,unsigned char *buf);
593
593
extern int _mi_read_cache(IO_CACHE *info,unsigned char *buff,my_off_t pos,
594
uint length,int re_read_if_possibly);
594
uint32_t length,int re_read_if_possibly);
595
595
extern uint64_t retrieve_auto_increment(MI_INFO *info,const unsigned char *record);
597
597
extern unsigned char *mi_alloc_rec_buff(MI_INFO *,ulong, unsigned char**);
670
extern uint _mi_get_block_info(MI_BLOCK_INFO *,File, my_off_t);
671
extern uint _mi_rec_pack(MI_INFO *info,unsigned char *to,const unsigned char *from);
672
extern uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
670
extern uint32_t _mi_get_block_info(MI_BLOCK_INFO *,File, my_off_t);
671
extern uint32_t _mi_rec_pack(MI_INFO *info,unsigned char *to,const unsigned char *from);
672
extern uint32_t _mi_pack_get_block_info(MI_INFO *myisam, MI_BIT_BUFF *bit_buff,
673
673
MI_BLOCK_INFO *info, unsigned char **rec_buff_p,
674
674
File file, my_off_t filepos);
675
extern void _my_store_blob_length(unsigned char *pos,uint pack_length,uint length);
675
extern void _my_store_blob_length(unsigned char *pos,uint32_t pack_length,uint32_t length);
676
676
extern void mi_report_error(int errcode, const char *file_name);
677
677
extern size_t mi_mmap_pread(MI_INFO *info, unsigned char *Buffer,
678
678
size_t Count, my_off_t offset, myf MyFlags);
683
683
extern size_t mi_nommap_pwrite(MI_INFO *info, const unsigned char *Buffer,
684
684
size_t Count, my_off_t offset, myf MyFlags);
686
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
686
uint32_t mi_state_info_write(File file, MI_STATE_INFO *state, uint32_t pWrite);
687
687
unsigned char *mi_state_info_read(unsigned char *ptr, MI_STATE_INFO *state);
688
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead);
689
uint mi_base_info_write(File file, MI_BASE_INFO *base);
688
uint32_t mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead);
689
uint32_t mi_base_info_write(File file, MI_BASE_INFO *base);
690
690
unsigned char *my_n_base_info_read(unsigned char *ptr, MI_BASE_INFO *base);
691
691
int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
692
692
unsigned char *mi_keyseg_read(unsigned char *ptr, HA_KEYSEG *keyseg);
693
uint mi_keydef_write(File file, MI_KEYDEF *keydef);
693
uint32_t mi_keydef_write(File file, MI_KEYDEF *keydef);
694
694
unsigned char *mi_keydef_read(unsigned char *ptr, MI_KEYDEF *keydef);
695
uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef);
695
uint32_t mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef);
696
696
unsigned char *mi_uniquedef_read(unsigned char *ptr, MI_UNIQUEDEF *keydef);
697
uint mi_recinfo_write(File file, MI_COLUMNDEF *recinfo);
697
uint32_t mi_recinfo_write(File file, MI_COLUMNDEF *recinfo);
698
698
unsigned char *mi_recinfo_read(unsigned char *ptr, MI_COLUMNDEF *recinfo);
699
699
extern int mi_disable_indexes(MI_INFO *info);
700
700
extern int mi_enable_indexes(MI_INFO *info);