175
175
int (*write_record)(struct st_myisam_info*, const uchar*);
176
176
int (*update_record)(struct st_myisam_info*, my_off_t, const uchar*);
177
177
int (*delete_record)(struct st_myisam_info*);
178
int (*read_rnd)(struct st_myisam_info*, uchar*, my_off_t, my_bool);
178
int (*read_rnd)(struct st_myisam_info*, uchar*, my_off_t, bool);
179
179
int (*compare_record)(struct st_myisam_info*, const uchar *);
180
180
/* Function to use for a row checksum. */
181
181
ha_checksum (*calc_checksum)(struct st_myisam_info*, const uchar *);
203
203
enum data_file_type data_file_type;
204
204
/* Below flag is needed to make log tables work with concurrent insert */
205
my_bool is_log_table;
207
my_bool changed, /* If changed since lock */
207
bool changed, /* If changed since lock */
208
208
global_changed, /* If changed since open */
210
210
temporary,delay_key_write,
285
285
IO_CACHE rec_cache; /* When cacheing records */
286
286
uint preload_buff_size; /* When preloading indexes */
287
287
myf lock_wait; /* is 0 or MY_DONT_WAIT */
288
my_bool was_locked; /* Was locked in panic */
289
my_bool append_insert_at_end; /* Set if concurrent insert */
291
my_bool page_changed; /* If info->buff can't be used for rnext */
292
my_bool buff_used; /* If info->buff has to be reread for rnext */
293
my_bool once_flags; /* For MYISAMMRG */
288
bool was_locked; /* Was locked in panic */
289
bool append_insert_at_end; /* Set if concurrent insert */
291
bool page_changed; /* If info->buff can't be used for rnext */
292
bool buff_used; /* If info->buff has to be reread for rnext */
293
bool once_flags; /* For MYISAMMRG */
295
295
index_cond_func_t index_cond_func; /* Index condition function */
296
296
void *index_cond_func_arg; /* parameter for the func */
324
324
my_off_t pos,max_pos,filepos,start_recpos;
325
325
uint key, key_length,real_key_length,sortbuff_size;
326
326
uint maxbuffers, keys, find_length, sort_keys_length;
327
my_bool fix_datafile, master;
328
my_bool calc_checksum; /* calculate table checksum */
327
bool fix_datafile, master;
328
bool calc_checksum; /* calculate table checksum */
329
329
MI_KEYDEF *keyinfo;
331
331
SORT_INFO *sort_info;
476
476
part_of_prev_key,prev_length,pack_marker;
477
477
uchar *key, *prev_key,*next_key_pos;
478
my_bool store_not_null;
481
481
/* Prototypes for intern functions */
485
485
extern int _mi_update_dynamic_record(MI_INFO*, my_off_t, const uchar*);
486
486
extern int _mi_delete_dynamic_record(MI_INFO *info);
487
487
extern int _mi_cmp_dynamic_record(MI_INFO *info,const uchar *record);
488
extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *,my_off_t, my_bool);
488
extern int _mi_read_rnd_dynamic_record(MI_INFO *, uchar *,my_off_t, bool);
489
489
extern int _mi_write_blob_record(MI_INFO*, const uchar*);
490
490
extern int _mi_update_blob_record(MI_INFO*, my_off_t, const uchar*);
491
491
extern int _mi_read_static_record(MI_INFO *info, my_off_t filepos,uchar *buf);
493
493
extern int _mi_update_static_record(MI_INFO*, my_off_t, const uchar*);
494
494
extern int _mi_delete_static_record(MI_INFO *info);
495
495
extern int _mi_cmp_static_record(MI_INFO *info,const uchar *record);
496
extern int _mi_read_rnd_static_record(MI_INFO*, uchar *,my_off_t, my_bool);
496
extern int _mi_read_rnd_static_record(MI_INFO*, uchar *,my_off_t, bool);
497
497
extern int _mi_ck_write(MI_INFO *info,uint keynr,uchar *key,uint length);
498
498
extern int _mi_ck_real_write_btree(MI_INFO *info, MI_KEYDEF *keyinfo,
499
499
uchar *key, uint key_length,
502
502
extern int _mi_insert(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,
503
503
uchar *anc_buff,uchar *key_pos,uchar *key_buff,
504
504
uchar *father_buff, uchar *father_keypos,
505
my_off_t father_page, my_bool insert_last);
505
my_off_t father_page, bool insert_last);
506
506
extern int _mi_split_page(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *key,
507
uchar *buff,uchar *key_buff, my_bool insert_last);
507
uchar *buff,uchar *key_buff, bool insert_last);
508
508
extern uchar *_mi_find_half_pos(uint nod_flag,MI_KEYDEF *keyinfo,uchar *page,
509
509
uchar *key,uint *return_key_length,
510
510
uchar **after_key);
546
546
uint nextflag,my_off_t pos);
547
547
extern int _mi_bin_search(struct st_myisam_info *info,MI_KEYDEF *keyinfo,
548
548
uchar *page,uchar *key,uint key_len,uint comp_flag,
549
uchar * *ret_pos,uchar *buff, my_bool *was_last_key);
549
uchar * *ret_pos,uchar *buff, bool *was_last_key);
550
550
extern int _mi_seq_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page,
551
551
uchar *key,uint key_len,uint comp_flag,
552
uchar **ret_pos,uchar *buff, my_bool *was_last_key);
552
uchar **ret_pos,uchar *buff, bool *was_last_key);
553
553
extern int _mi_prefix_search(MI_INFO *info,MI_KEYDEF *keyinfo,uchar *page,
554
554
uchar *key,uint key_len,uint comp_flag,
555
uchar **ret_pos,uchar *buff, my_bool *was_last_key);
555
uchar **ret_pos,uchar *buff, bool *was_last_key);
556
556
extern my_off_t _mi_kpos(uint nod_flag,uchar *after_key);
557
557
extern void _mi_kpointer(MI_INFO *info,uchar *buff,my_off_t pos);
558
558
extern my_off_t _mi_dpos(MI_INFO *info, uint nod_flag,uchar *after_key);
604
604
extern ulong _mi_rec_unpack(MI_INFO *info,uchar *to,uchar *from,
605
605
ulong reclength);
606
extern my_bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos,
607
ulong packed_length, my_bool with_checkum);
606
extern bool _mi_rec_check(MI_INFO *info,const uchar *record, uchar *packpos,
607
ulong packed_length, bool with_checkum);
608
608
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
609
609
my_off_t next_filepos,uchar **record,
610
610
ulong *reclength,int *flag);
611
611
extern void _mi_print_key(FILE *stream,HA_KEYSEG *keyseg,const uchar *key,
613
extern my_bool _mi_read_pack_info(MI_INFO *info,bool fix_keys);
613
extern bool _mi_read_pack_info(MI_INFO *info,bool fix_keys);
614
614
extern int _mi_read_pack_record(MI_INFO *info,my_off_t filepos,uchar *buf);
615
extern int _mi_read_rnd_pack_record(MI_INFO*, uchar *,my_off_t, my_bool);
615
extern int _mi_read_rnd_pack_record(MI_INFO*, uchar *,my_off_t, bool);
616
616
extern int _mi_pack_rec_unpack(MI_INFO *info, MI_BIT_BUFF *bit_buff,
617
617
uchar *to, uchar *from, ulong reclength);
618
618
extern uint64_t mi_safe_mul(uint64_t a,uint64_t b);
690
690
const uchar *record,my_off_t filepos,
692
692
extern void mi_report_error(int errcode, const char *file_name);
693
extern my_bool _mi_memmap_file(MI_INFO *info);
693
extern bool _mi_memmap_file(MI_INFO *info);
694
694
extern void _mi_unmap_file(MI_INFO *info);
695
695
extern uint save_pack_length(uint version, uchar *block_buff, ulong length);
696
696
extern uint read_pack_length(uint version, const uchar *buf, ulong *length);
707
707
uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
708
708
uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state);
709
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead);
709
uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, bool pRead);
710
710
uint mi_base_info_write(File file, MI_BASE_INFO *base);
711
711
uchar *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base);
712
712
int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
723
723
ulong _my_calc_total_blob_length(MI_INFO *info, const uchar *record);
724
724
ha_checksum mi_checksum(MI_INFO *info, const uchar *buf);
725
725
ha_checksum mi_static_checksum(MI_INFO *info, const uchar *buf);
726
my_bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
726
bool mi_check_unique(MI_INFO *info, MI_UNIQUEDEF *def, uchar *record,
727
727
ha_checksum unique_hash, my_off_t pos);
728
728
ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const uchar *buf);
729
729
int _mi_cmp_static_unique(MI_INFO *info, MI_UNIQUEDEF *def,
731
731
int _mi_cmp_dynamic_unique(MI_INFO *info, MI_UNIQUEDEF *def,
732
732
const uchar *record, my_off_t pos);
733
733
int mi_unique_comp(MI_UNIQUEDEF *def, const uchar *a, const uchar *b,
734
my_bool null_are_equal);
734
bool null_are_equal);
735
735
void mi_get_status(void* param, int concurrent_insert);
736
736
void mi_update_status(void* param);
737
737
void mi_restore_status(void* param);
739
739
bool mi_check_status(void* param);
741
741
extern MI_INFO *test_if_reopen(char *filename);
742
my_bool check_table_is_closed(const char *name, const char *where);
742
bool check_table_is_closed(const char *name, const char *where);
743
743
int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup);
744
744
int mi_open_keyfile(MYISAM_SHARE *share);
745
745
void mi_setup_functions(register MYISAM_SHARE *share);
746
my_bool mi_dynmap_file(MI_INFO *info, my_off_t size);
746
bool mi_dynmap_file(MI_INFO *info, my_off_t size);
747
747
void mi_remap_file(MI_INFO *info, my_off_t size);
749
749
int mi_check_index_cond(register MI_INFO *info, uint keynr, uchar *record);
759
759
int flush_blocks(MI_CHECK *param, KEY_CACHE *key_cache, File file);
761
761
int sort_write_record(MI_SORT_PARAM *sort_param);
762
int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, ulong);
762
int _create_index_by_sort(MI_SORT_PARAM *info,bool no_messages, ulong);
764
764
extern void mi_set_index_cond_func(MI_INFO *info, index_cond_func_t func,